fix(course-visibility): allow for caching Nothing results of getBy
This commit is contained in:
parent
23aca1caa4
commit
f129ce6b2b
@ -989,7 +989,7 @@ tagAccessPredicate AuthAllocationTime = APDB $ \mAuthId route _ -> case route of
|
|||||||
tagAccessPredicate AuthCourseTime = APDB $ \_mAuthId route _ -> case route of
|
tagAccessPredicate AuthCourseTime = APDB $ \_mAuthId route _ -> case route of
|
||||||
CourseR tid ssh csh _ -> maybeT (unauthorizedI MsgUnauthorizedCourseTime) $ do
|
CourseR tid ssh csh _ -> maybeT (unauthorizedI MsgUnauthorizedCourseTime) $ do
|
||||||
now <- liftIO getCurrentTime
|
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
|
guard $ courseIsVisible' now course
|
||||||
return Authorized
|
return Authorized
|
||||||
r -> $unsupportedAuthPredicate AuthCourseTime r
|
r -> $unsupportedAuthPredicate AuthCourseTime r
|
||||||
|
|||||||
Reference in New Issue
Block a user