filtre out closed courses in achievements

This commit is contained in:
Filip Gralinski 2017-10-03 22:16:00 +02:00
parent d4d4d4c5ad
commit ab76d28b43
2 changed files with 5 additions and 3 deletions

View File

@ -45,7 +45,8 @@ postAchievementsR = do
doAchievements mUser formWidget formEnctype = do
achievements <- runDB $ selectList [] [Asc AchievementName]
mUser <- maybeAuth
achievementInfos <- runDB $ mapM (getAchievementInfo mUser) achievements
achievementInfos' <- runDB $ mapM (getAchievementInfo mUser) achievements
let achievementInfos = Import.filter (not . courseClosed . entityVal . achievementInfoCourse) achievementInfos'
tagsAvailableAsJSON <- runDB $ getAvailableTagsAsJSON

View File

@ -104,7 +104,8 @@ WorkingOn
UniqueWorkingOnAchievementUser achievement user
Course
name Text
code Text Maybe
closed Bool Maybe
code Text
closed Bool
UniqueCourseName name
UniqueCourseCode code
-- By default this file is used in Model.hs (which is imported by Foundation.hs)