From cf1c63cc7836693d272ee9d181fc62e5c5b6e7df Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 30 Jul 2019 15:13:13 +0200 Subject: [PATCH] refactor: fix hlint errors --- src/Handler/Course.hs | 3 +-- src/Handler/Course/ParticipantInvite.hs | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index c7e8c7cb6..aae2bc46a 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -25,5 +25,4 @@ getCNotesR, postCNotesR :: TermId -> SchoolId -> CourseShorthand -> Handler Html -- PROBLEM: Correctors usually don't know Participants by name (anonymous), maybe notes are not shared? -- If they are shared, adjust MsgCourseUserNoteTooltip getCNotesR = postCNotesR -postCNotesR _ _ _ = do - defaultLayout $ [whamlet|You have corrector access to this course.|] +postCNotesR _ _ _ = defaultLayout [whamlet|You have corrector access to this course.|] diff --git a/src/Handler/Course/ParticipantInvite.hs b/src/Handler/Course/ParticipantInvite.hs index 3426bb872..24e95743c 100644 --- a/src/Handler/Course/ParticipantInvite.hs +++ b/src/Handler/Course/ParticipantInvite.hs @@ -128,20 +128,20 @@ postCAddUserR tid ssh csh = do -- register known users execWriterT $ mapM (registerUser cid) uids - when (not $ null emails) $ + unless (null emails) $ tell . pure <=< messageI Success . MsgCourseParticipantsInvited $ length emails - when (not $ null aurAlreadyRegistered) $ do + unless (null aurAlreadyRegistered) $ do let modalTrigger = [whamlet|_{MsgCourseParticipantsAlreadyRegistered (length aurAlreadyRegistered)}|] modalContent = $(widgetFile "messages/courseInvitationAlreadyRegistered") tell . pure <=< messageWidget Info $ msgModal modalTrigger (Right modalContent) - when (not $ null aurNoUniquePrimaryField) $ do + unless (null aurNoUniquePrimaryField) $ do let modalTrigger = [whamlet|_{MsgCourseParticipantsRegisteredWithoutField (length aurNoUniquePrimaryField)}|] modalContent = $(widgetFile "messages/courseInvitationRegisteredWithoutField") tell . pure <=< messageWidget Warning $ msgModal modalTrigger (Right modalContent) - when (not $ null aurSuccess) $ + unless (null aurSuccess) $ tell . pure <=< messageI Success . MsgCourseParticipantsRegistered $ length aurSuccess registerUser :: CourseId -> UserId -> WriterT AddRecipientsResult (YesodJobDB UniWorX) ()