diff --git a/src/Foundation/Authorization.hs b/src/Foundation/Authorization.hs index 2be002d27..a318ca559 100644 --- a/src/Foundation/Authorization.hs +++ b/src/Foundation/Authorization.hs @@ -1505,7 +1505,7 @@ tagAccessPredicate AuthCapacity = APDB $ \_ _ _ route _ -> case route of eid <- $cachedHereBinary (cid, examn) . MaybeT . getKeyBy $ UniqueExam cid examn Entity occId ExamOccurrence{..} <- $cachedHereBinary (eid, occn) . MaybeT . getBy $ UniqueExamOccurrence eid occn -- Nothing means unlimited size - whenIsJust examOccurrenceCapacity $ \capacity -> + whenIsJust examOccurrenceCapacity $ \capacity -> do registered <- $cachedHereBinary occId . lift $ fromIntegral <$> count [ ExamRegistrationOccurrence ==. Just occId, ExamRegistrationExam ==. eid ] guard $ capacity > registered return Authorized