fix: tests & hlint

This commit is contained in:
Gregor Kleen 2020-01-15 17:20:13 +01:00
parent b3ce3dd93a
commit 4e9b618b61
3 changed files with 6 additions and 2 deletions

View File

@ -191,7 +191,7 @@ makeExternalExamUsersTable mode (Entity eeId ExternalExam{..}) = do
E.where_ $ result E.^. ExternalExamResultExam E.==. E.val eeId
unless (isLecturer || mode == EEUMUsers) $ do
unless (isLecturer || mode == EEUMUsers) $
E.where_ $ ExternalExam.examOfficeExternalExamResultAuth (E.val uid) result
return (result, user, isSynced)

View File

@ -50,7 +50,7 @@ guessUser (Set.toList -> criteria) = $cachedHereBinary criteria $ go False
E.where_ . E.and $ map (toSql user) criteria
return user
users <- retrieveUsers
let users' = reverse $ sortBy closeness users
let users' = sortBy (flip closeness) users
matchesMatriculation :: Entity User -> Maybe Bool
matchesMatriculation = preview $ _entityVal . _userMatrikelnummer . to (\userMatr -> all ((== userMatr) . Just) $ criteria ^.. folded . _guessUserMatrikelnummer)

View File

@ -70,6 +70,10 @@ instance Arbitrary ExamOfficeR where
arbitrary = genericArbitrary
shrink = genericShrink
instance Arbitrary EExamR where
arbitrary = genericArbitrary
shrink = genericShrink
instance Arbitrary CourseNewsR where
arbitrary = genericArbitrary
shrink = genericShrink