mirror of
https://github.com/postgres/pgweb.git
synced 2025-08-03 15:38:59 +00:00
Prevent event swith enddate before startdate
This commit is contained in:
@ -39,6 +39,8 @@ class EventForm(forms.ModelForm):
|
||||
if self.instance.pk and self.instance.approved:
|
||||
if self.cleaned_data['enddate'] != self.instance.enddate:
|
||||
raise ValidationError("You cannot change the dates on events that have been approved")
|
||||
if self.cleaned_data['enddate'] < self.cleaned_data['startdate']:
|
||||
raise ValidationError("End date cannot be before start date!")
|
||||
return self.cleaned_data['enddate']
|
||||
|
||||
class Meta:
|
||||
|
Reference in New Issue
Block a user