chore(tutorial): WIP towards tutorial templates, part 2
This commit is contained in:
parent
5400c32477
commit
314e661108
@ -78,7 +78,7 @@ data CourseRegisterActionData
|
||||
| CourseRegisterActionAddTutorialMemberData
|
||||
{ crActIdent :: UserSearchKey
|
||||
, crActUser :: (UserId, User)
|
||||
, crActTutorial :: TutorialName
|
||||
, crActTutorial :: (Maybe TutorialName, Maybe TutorialType, Maybe Day)
|
||||
}
|
||||
-- | CourseRegisterActionUnknownPersonData -- pseudo-action; just for display
|
||||
-- { crActUnknownPersonIdent :: Text
|
||||
@ -168,8 +168,8 @@ postTAddUserR tid ssh csh tut = do
|
||||
tutActs = Set.filter (is _CourseRegisterActionAddTutorialMemberData) confirmedActs
|
||||
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 --TODO
|
||||
forM_ actTutorial $ \(tutName,tutType,tutDay) -> do
|
||||
tutId <- upsertNewTutorial cid (fromMaybe "TODO" tutName) tutType tutDay
|
||||
registerTutorialMembers tutId registeredUsers
|
||||
|
||||
if
|
||||
@ -323,7 +323,7 @@ upsertNewTutorial cid newTutorialName newTutorialType anchorDay = runDB $ do
|
||||
, tutorialDeregisterUntil = mvTime tutorialDeregisterUntil
|
||||
, tutorialLastChanged = now
|
||||
, ..
|
||||
} [] -- update cannot happen due to previous case
|
||||
} [] -- update cannot happen due to previous case
|
||||
audit $ TransactionTutorialEdit tutId
|
||||
return tutId
|
||||
_ -> do
|
||||
@ -343,8 +343,7 @@ upsertNewTutorial cid newTutorialName newTutorialType anchorDay = runDB $ do
|
||||
, tutorialLastChanged = now
|
||||
, tutorialTutorControlled = False
|
||||
, tutorialFirstDay = anchorDay
|
||||
}
|
||||
[ ] -- update cannot happen due to previous cases
|
||||
} [] -- update cannot happen due to previous cases
|
||||
audit $ TransactionTutorialEdit tutId
|
||||
return tutId
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user