fix adding events

This commit is contained in:
Flatlogic Bot 2026-04-02 21:22:55 +00:00
parent 242b727260
commit 1a4a7390f2
2 changed files with 1 additions and 1 deletions

View File

@ -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):