Merge branch 'fradrive/driving-course-participants' of gitlab.ifi.lmu.de:fradrive/fradrive into fradrive/driving-course-participants
This commit is contained in:
commit
f8f3475d30
@ -129,7 +129,7 @@ postCAddUserR tid ssh csh = do
|
||||
let
|
||||
users = Map.fromList . fmap (\act -> (crActIdent act, Just . view _1 $ crActUser act)) $ Set.toList confirmedActs
|
||||
tutActs = Set.filter (is _CourseRegisterActionAddTutorialMemberData) confirmedActs
|
||||
actTutorial = fmap crActTutorial $ Set.lookupMin tutActs -- tutorial ident must be the same for every added member!
|
||||
actTutorial = crActTutorial <$> Set.lookupMin tutActs -- tutorial ident must be the same for every added member!
|
||||
registeredUsers <- registerUsers cid users
|
||||
forM_ actTutorial $ \tutName -> do
|
||||
tutId <- upsertNewTutorial cid tutName
|
||||
@ -288,7 +288,7 @@ upsertNewTutorial cid tutorialName = do
|
||||
|
||||
registerTutorialMembers :: TutorialId -> Set UserId -> Handler ()
|
||||
registerTutorialMembers tutId (Set.toList -> users) = runDB $ do
|
||||
prevParticipants <- fmap (Set.fromList . fmap entityKey) $ selectList [TutorialParticipantUser <-. users, TutorialParticipantTutorial ==. tutId] []
|
||||
prevParticipants <- Set.fromList . fmap entityKey <$> selectList [TutorialParticipantUser <-. users, TutorialParticipantTutorial ==. tutId] []
|
||||
participants <- fmap Set.fromList . for users $ \tutorialParticipantUser -> do
|
||||
Entity tutPartId _ <- upsert TutorialParticipant { tutorialParticipantTutorial = tutId, .. } []
|
||||
audit $ TransactionTutorialParticipantEdit tutId tutPartId tutorialParticipantUser
|
||||
|
||||
Reference in New Issue
Block a user