chore: hlint

This commit is contained in:
Sarah Vaupel 2022-12-13 21:11:38 +01:00
parent f8f3475d30
commit a6fcbec78a
4 changed files with 5 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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