diff --git a/src/Handler/LMS.hs b/src/Handler/LMS.hs index 240a900f6..97be8be55 100644 --- a/src/Handler/LMS.hs +++ b/src/Handler/LMS.hs @@ -375,9 +375,9 @@ mkLmsTable :: forall h p cols act act'. -> DB (FormResult (act', Set UserId), Widget) mkLmsTable nlimit noffset isAdmin (Entity qid quali) acts cols psValidator = do now <- liftIO getCurrentTime - -- currentRoute <- fromMaybe (error "mkLmsAllTable called from 404-handler") <$> liftHandler getCurrentRoute -- we know the route here + currentRoute <- fromMaybe (error "mkLmsAllTable called from 404-handler") <$> liftHandler getCurrentRoute -- we know the route here let - currentRoute = LmsR (qualificationSchool quali) (qualificationShorthand quali) + -- currentRoute = LmsR (qualificationSchool quali) (qualificationShorthand quali) -- bad idea as seen nowaday = utctDay now mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday csvName = T.replace " " "-" $ CI.original (quali ^. _qualificationName) @@ -500,12 +500,12 @@ mkLmsTable nlimit noffset isAdmin (Entity qid quali) acts cols psValidator = do getLmsR, postLmsR :: SchoolId -> QualificationShorthand -> Handler Html getLmsR = postLmsR -postLmsR sid qsh = redirect $ LmsLSR sid qsh 250 0 +postLmsR sid qsh = redirect $ LmsLSR sid qsh 500 0 getLmsLSR, postLmsLSR :: SchoolId -> QualificationShorthand -> Int64 -> Int64 -> Handler Html getLmsLSR = postLmsLSR postLmsLSR sid qsh nlimit noffset - | nlimit < 0 || noffset < 0 = redirect $ LmsLSR sid qsh 200 0 + | nlimit < 0 || noffset < 0 = redirect $ LmsLSR sid qsh 500 0 | otherwise = do isAdmin <- hasReadAccessTo AdminR currentRoute <- fromMaybe (error "correctionsR called from 404-handler") <$> getCurrentRoute -- This should never be called from a 404 handler diff --git a/src/Jobs/Handler/LMS.hs b/src/Jobs/Handler/LMS.hs index 42f4f105f..e3b469360 100644 --- a/src/Jobs/Handler/LMS.hs +++ b/src/Jobs/Handler/LMS.hs @@ -244,7 +244,7 @@ dispatchJobLmsUserlist qid = JobHandlerAtomic act (luser :& lulist) <- E.from $ E.table @LmsUser `E.leftJoin` E.table @LmsUserlist `E.on` (\(luser :& lulist) -> luser E.^. LmsUserIdent E.=?. lulist E.?. LmsUserlistIdent - E.&&. luser E.^. LmsUserQualification E.=?. lulist E.?. LmsUserlistQualification) + E.&&. luser E.^. LmsUserQualification E.=?. lulist E.?. LmsUserlistQualification) E.where_ $ luser E.^. LmsUserQualification E.==. E.val qid E.&&. E.isNothing (luser E.^. LmsUserEnded) -- do not process closed learners return (luser, lulist)