fix: correctly apply suggestion

This commit is contained in:
Wolfgang Witt 2021-03-29 12:55:52 +02:00 committed by Gregor Kleen
parent fcc5930a3c
commit 67d6fd7d43

View File

@ -1504,7 +1504,6 @@ tagAccessPredicate AuthCapacity = APDB $ \_ _ _ route _ -> case route of
cid <- $cachedHereBinary (tid, ssh, csh) . MaybeT . getKeyBy $ TermSchoolCourseShort tid ssh csh
eid <- $cachedHereBinary (cid, examn) . MaybeT . getKeyBy $ UniqueExam cid examn
Entity occId ExamOccurrence{..} <- $cachedHereBinary (eid, occn) . MaybeT . getBy $ UniqueExamOccurrence eid occn
registered <- $cachedHereBinary occId . lift $ fromIntegral <$> count [ ExamRegistrationOccurrence ==. Just occId, ExamRegistrationExam ==. eid ]
-- Nothing means unlimited size
whenIsJust examOccurrenceCapacity $ \capacity ->
registered <- $cachedHereBinary occId . lift $ fromIntegral <$> count [ ExamRegistrationOccurrence ==. Just occId, ExamRegistrationExam ==. eid ]