diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 73573bf..25fd7c1 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index d2892a0..a095a74 100644 --- a/core/models.py +++ b/core/models.py @@ -24,7 +24,7 @@ class Event(models.Model): def clean(self): super().clean() - if self.end <= self.start: + if self.start is not None and self.end is not None and self.end <= self.start: raise ValidationError({'end': 'End time must be after the start time.'}) def save(self, *args, **kwargs):