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
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user