error handling exam template -> just take first default if there are

more then one
This commit is contained in:
anhefti 2022-05-03 10:39:07 +02:00
parent 6e4a1afd9e
commit b63a5f0d44

View file

@ -110,10 +110,6 @@ public class ExamTemplateDAOImpl implements ExamTemplateDAO {
throw new ResourceNotFoundException(EntityType.EXAM_TEMPLATE, String.valueOf(institutionId));
}
if (defaults.size() != 1) {
throw new IllegalStateException("Expected one default but was: " + defaults.size());
}
return defaults.get(0);
})
.flatMap(this::toDomainModel);