chore: check for no users first
This commit is contained in:
parent
5dc37a07c1
commit
767090ded1
@ -278,11 +278,11 @@ examAutoOccurrence :: forall seed.
|
||||
-> Map UserId (User, Maybe ExamOccurrenceId)
|
||||
-> Either ExamAutoOccurrenceException (ExamOccurrenceMapping ExamOccurrenceId, Map UserId (Maybe ExamOccurrenceId))
|
||||
examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences users
|
||||
| Map.null users'
|
||||
= Left ExamAutoOccurrenceExceptionNoUsers
|
||||
| sum occurrences' < usersCount
|
||||
|| sum occurrences' <= 0
|
||||
= Left ExamAutoOccurrenceExceptionNotEnoughSpace
|
||||
| Map.null users'
|
||||
= Left ExamAutoOccurrenceExceptionNoUsers
|
||||
| otherwise
|
||||
= case rule of
|
||||
ExamRoomRandom
|
||||
|
||||
Loading…
Reference in New Issue
Block a user