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))
|
type CourseTableExpr = (E.SqlExpr (Entity Course) `E.InnerJoin` E.SqlExpr (Entity School))
|
||||||
|
|
||||||
queryCourse :: IndexPreservingGetter CourseTableExpr (E.SqlExpr (Entity Course))
|
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 :: 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 :: IndexPreservingGetter CourseTableExpr (E.SqlExpr (E.Value Int))
|
||||||
queryParticipants = queryCourse . to (E.^. CourseId) . to numCourseParticipants
|
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 :: CourseId -> TutorialIdent -> Handler TutorialId
|
||||||
upsertNewTutorial cid tutorialName = do
|
upsertNewTutorial cid tutorialName = do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
tutId <- runDB $ do
|
runDB $ do
|
||||||
Entity tutId _ <- upsert
|
Entity tutId _ <- upsert
|
||||||
Tutorial
|
Tutorial
|
||||||
{ tutorialCourse = cid
|
{ tutorialCourse = cid
|
||||||
@ -284,7 +284,6 @@ upsertNewTutorial cid tutorialName = do
|
|||||||
]
|
]
|
||||||
audit $ TransactionTutorialEdit tutId
|
audit $ TransactionTutorialEdit tutId
|
||||||
return tutId
|
return tutId
|
||||||
return tutId
|
|
||||||
|
|
||||||
registerTutorialMembers :: TutorialId -> Set UserId -> Handler ()
|
registerTutorialMembers :: TutorialId -> Set UserId -> Handler ()
|
||||||
registerTutorialMembers tutId (Set.toList -> users) = runDB $ do
|
registerTutorialMembers tutId (Set.toList -> users) = runDB $ do
|
||||||
|
|||||||
@ -52,7 +52,7 @@ courseRegisterForm (Entity cid Course{..}) = liftHandler $ do
|
|||||||
= BtnCourseDeregister
|
= BtnCourseDeregister
|
||||||
| otherwise
|
| otherwise
|
||||||
= BtnCourseRegister
|
= BtnCourseRegister
|
||||||
isRegistered = btn `elem` [BtnCourseDeregister]
|
isRegistered = btn == BtnCourseDeregister
|
||||||
return . (, btn) . wFormToAForm $ do
|
return . (, btn) . wFormToAForm $ do
|
||||||
MsgRenderer mr <- getMsgRenderer
|
MsgRenderer mr <- getMsgRenderer
|
||||||
|
|
||||||
|
|||||||
@ -132,9 +132,8 @@ courseIsVisible :: UTCTime
|
|||||||
-> E.SqlExpr (Entity Course)
|
-> E.SqlExpr (Entity Course)
|
||||||
-> E.SqlExpr (E.Value Bool)
|
-> E.SqlExpr (E.Value Bool)
|
||||||
courseIsVisible now course =
|
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)
|
E.&&. E.maybe E.true (\visibleTo -> E.val now E.<=. visibleTo) (course E.^. CourseVisibleTo)
|
||||||
)
|
|
||||||
|
|
||||||
courseIsVisible' :: UTCTime
|
courseIsVisible' :: UTCTime
|
||||||
-> Entity Course
|
-> Entity Course
|
||||||
|
|||||||
Reference in New Issue
Block a user