tidy up exam start and end dates a little

This commit is contained in:
Ross
2024-05-20 10:06:04 +01:00
parent d50fbaafd6
commit 966de4a139
4 changed files with 55 additions and 5 deletions
+1 -3
View File
@@ -598,9 +598,7 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin):
raise ValidationError("If restrict to dates is set, a start date must be set")
if self.end_date is not None and self.end_date <= self.start_date:
print(f"{self.start_date=}")
print(f"{self.end_date=}")
raise ValidationError("End date must be after start date")
raise ValidationError({"end_date" : "End date must be after start date"})
return super().clean(*args, **kwargs)