From 64f771518ede9e1b11aaeeaaeb3a2e7d449a13ed Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 30 Sep 2019 08:57:33 +0200 Subject: [PATCH] fix(course-application): better display of priorities --- src/Handler/Allocation/Application.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Handler/Allocation/Application.hs b/src/Handler/Allocation/Application.hs index d9e48239a..912fd8450 100644 --- a/src/Handler/Allocation/Application.hs +++ b/src/Handler/Allocation/Application.hs @@ -82,8 +82,7 @@ applicationForm maId@(is _Just -> isAlloc) cid uid ApplicationFormMode{..} csrf coursesNum <- fromIntegral . fromMaybe 1 <$> for maId (\aId -> count [AllocationCourseAllocation ==. aId]) course <- getJust cid (fromMaybe 0 -> maxPrio) <- fmap ((>>= E.unValue) . listToMaybe) . E.select . E.from $ \courseApplication -> do - E.where_ $ courseApplication E.^. CourseApplicationCourse E.==. E.val cid - E.&&. courseApplication E.^. CourseApplicationUser E.==. E.val uid + E.where_ $ courseApplication E.^. CourseApplicationUser E.==. E.val uid E.&&. courseApplication E.^. CourseApplicationAllocation E.==. E.val maId E.&&. E.not_ (E.isNothing $ courseApplication E.^. CourseApplicationAllocationPriority) return . E.joinV . E.max_ $ courseApplication E.^. CourseApplicationAllocationPriority