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)
|
-> Map UserId (User, Maybe ExamOccurrenceId)
|
||||||
-> Either ExamAutoOccurrenceException (ExamOccurrenceMapping ExamOccurrenceId, Map UserId (Maybe ExamOccurrenceId))
|
-> Either ExamAutoOccurrenceException (ExamOccurrenceMapping ExamOccurrenceId, Map UserId (Maybe ExamOccurrenceId))
|
||||||
examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences users
|
examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences users
|
||||||
|
| Map.null users'
|
||||||
|
= Left ExamAutoOccurrenceExceptionNoUsers
|
||||||
| sum occurrences' < usersCount
|
| sum occurrences' < usersCount
|
||||||
|| sum occurrences' <= 0
|
|| sum occurrences' <= 0
|
||||||
= Left ExamAutoOccurrenceExceptionNotEnoughSpace
|
= Left ExamAutoOccurrenceExceptionNotEnoughSpace
|
||||||
| Map.null users'
|
|
||||||
= Left ExamAutoOccurrenceExceptionNoUsers
|
|
||||||
| otherwise
|
| otherwise
|
||||||
= case rule of
|
= case rule of
|
||||||
ExamRoomRandom
|
ExamRoomRandom
|
||||||
|
|||||||
Reference in New Issue
Block a user