fix(study-features): account for existing StudyFeatures

This commit is contained in:
Gregor Kleen 2019-11-28 16:05:15 +01:00
parent bf9f210b93
commit b6cada43f2

View File

@ -3529,12 +3529,17 @@ upsertCampusUser ldapData Creds{..} = do
Nothing -> [] Nothing -> []
) [] ) []
case oldFs of case oldFs of
[oldF] -> update oldF [ StudyFeaturesUpdated =. now [oldF] -> update oldF
, StudyFeaturesValid =. True [ StudyFeaturesUpdated =. now
, StudyFeaturesField =. studyFeaturesField , StudyFeaturesValid =. True
, StudyFeaturesSuperField =. studyFeaturesSuperField , StudyFeaturesField =. studyFeaturesField
] , StudyFeaturesSuperField =. studyFeaturesSuperField
_other -> insert_ f ]
_other -> void $ upsert f
[ StudyFeaturesUpdated =. now
, StudyFeaturesValid =. True
, StudyFeaturesSuperField =. studyFeaturesSuperField
]
associateUserSchoolsByTerms userId associateUserSchoolsByTerms userId
let let