fix adding events
This commit is contained in:
parent
242b727260
commit
1a4a7390f2
Binary file not shown.
@ -24,7 +24,7 @@ class Event(models.Model):
|
|||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
super().clean()
|
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.'})
|
raise ValidationError({'end': 'End time must be after the start time.'})
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user