chore: hlint
This commit is contained in:
parent
f8f3475d30
commit
a6fcbec78a
@ -51,10 +51,10 @@ resultMayEditCourse = _dbrOutput . _5
|
||||
type CourseTableExpr = (E.SqlExpr (Entity Course) `E.InnerJoin` E.SqlExpr (Entity School))
|
||||
|
||||
queryCourse :: IndexPreservingGetter CourseTableExpr (E.SqlExpr (Entity Course))
|
||||
queryCourse = to $ $(E.sqlIJproj 2 1)
|
||||
queryCourse = to $(E.sqlIJproj 2 1)
|
||||
|
||||
querySchool :: IndexPreservingGetter CourseTableExpr (E.SqlExpr (Entity School))
|
||||
querySchool = to $ $(E.sqlIJproj 2 2)
|
||||
querySchool = to $(E.sqlIJproj 2 2)
|
||||
|
||||
queryParticipants :: IndexPreservingGetter CourseTableExpr (E.SqlExpr (E.Value Int))
|
||||
queryParticipants = queryCourse . to (E.^. CourseId) . to numCourseParticipants
|
||||
|
||||
@ -261,7 +261,7 @@ registerUser cid (_avsIdent, Just uid) = exceptT return return $ do
|
||||
upsertNewTutorial :: CourseId -> TutorialIdent -> Handler TutorialId
|
||||
upsertNewTutorial cid tutorialName = do
|
||||
now <- liftIO getCurrentTime
|
||||
tutId <- runDB $ do
|
||||
runDB $ do
|
||||
Entity tutId _ <- upsert
|
||||
Tutorial
|
||||
{ tutorialCourse = cid
|
||||
@ -284,7 +284,6 @@ upsertNewTutorial cid tutorialName = do
|
||||
]
|
||||
audit $ TransactionTutorialEdit tutId
|
||||
return tutId
|
||||
return tutId
|
||||
|
||||
registerTutorialMembers :: TutorialId -> Set UserId -> Handler ()
|
||||
registerTutorialMembers tutId (Set.toList -> users) = runDB $ do
|
||||
|
||||
@ -52,7 +52,7 @@ courseRegisterForm (Entity cid Course{..}) = liftHandler $ do
|
||||
= BtnCourseDeregister
|
||||
| otherwise
|
||||
= BtnCourseRegister
|
||||
isRegistered = btn `elem` [BtnCourseDeregister]
|
||||
isRegistered = btn == BtnCourseDeregister
|
||||
return . (, btn) . wFormToAForm $ do
|
||||
MsgRenderer mr <- getMsgRenderer
|
||||
|
||||
|
||||
@ -132,9 +132,8 @@ courseIsVisible :: UTCTime
|
||||
-> E.SqlExpr (Entity Course)
|
||||
-> E.SqlExpr (E.Value Bool)
|
||||
courseIsVisible now course =
|
||||
(E.maybe E.false (\visibleFrom -> visibleFrom E.<=. E.val now) (course E.^. CourseVisibleFrom)
|
||||
E.maybe E.false (\visibleFrom -> visibleFrom E.<=. E.val now) (course E.^. CourseVisibleFrom)
|
||||
E.&&. E.maybe E.true (\visibleTo -> E.val now E.<=. visibleTo) (course E.^. CourseVisibleTo)
|
||||
)
|
||||
|
||||
courseIsVisible' :: UTCTime
|
||||
-> Entity Course
|
||||
|
||||
Loading…
Reference in New Issue
Block a user