diff --git a/src/Handler/Course/ParticipantInvite.hs b/src/Handler/Course/ParticipantInvite.hs index 2c079fdbd..78c5efeaf 100644 --- a/src/Handler/Course/ParticipantInvite.hs +++ b/src/Handler/Course/ParticipantInvite.hs @@ -310,7 +310,7 @@ upsertNewTutorial :: CourseId -> TutorialName -> Maybe TutorialType -> Maybe Day upsertNewTutorial cid newTutorialName newTutorialType newFirstDay = runDB $ do now <- liftIO getCurrentTime existingTut <- getBy $ UniqueTutorial cid newTutorialName - templateEnt <- selectFirst [TutorialType <-. tutorialTemplateNames newTutorialType] [Desc TutorialType] + templateEnt <- selectFirst [TutorialType <-. tutorialTemplateNames newTutorialType] [Desc TutorialType, Asc TutorialName] case (existingTut, newFirstDay, templateEnt) of (Just Entity{entityKey=tid},_,_) -> return tid -- no need to update, we ignore the anchor day (Nothing, Just moveDay, Just Entity{entityVal=Tutorial{..}}) -> do