From f129ce6b2b12e4cfe856f1de728873868c7a0bba Mon Sep 17 00:00:00 2001 From: Sarah Vaupel <> Date: Wed, 5 Aug 2020 10:50:19 +0200 Subject: [PATCH] fix(course-visibility): allow for caching Nothing results of getBy --- src/Foundation.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Foundation.hs b/src/Foundation.hs index 12b96b733..4912f7e01 100644 --- a/src/Foundation.hs +++ b/src/Foundation.hs @@ -989,7 +989,7 @@ tagAccessPredicate AuthAllocationTime = APDB $ \mAuthId route _ -> case route of tagAccessPredicate AuthCourseTime = APDB $ \_mAuthId route _ -> case route of CourseR tid ssh csh _ -> maybeT (unauthorizedI MsgUnauthorizedCourseTime) $ do now <- liftIO getCurrentTime - Entity _cid course <- $cachedHereBinary (tid, ssh, csh) . MaybeT . getBy $ TermSchoolCourseShort tid ssh csh + Entity _cid course <- MaybeT . $cachedHereBinary (tid, ssh, csh) . getBy $ TermSchoolCourseShort tid ssh csh guard $ courseIsVisible' now course return Authorized r -> $unsupportedAuthPredicate AuthCourseTime r