Skip to content

Commit

Permalink
Web: More validation for "services public" and end date
Browse files Browse the repository at this point in the history
  • Loading branch information
F30 committed Oct 5, 2020
1 parent b63b8d5 commit b9f83b9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ctf_gameserver/web/scoring/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,13 @@ def clean_tick_duration(self):
raise forms.ValidationError(_('The tick duration has to be a multitude of 60!'))

return tick_duration

def clean(self):
services_public = self.cleaned_data['services_public']
start = self.cleaned_data['start']
end = self.cleaned_data['end']

if services_public > start:
raise forms.ValidationError(_('Services public time must not be after start time'))
if end <= start:
raise forms.ValidationError(_('End time must be after start time'))

0 comments on commit b9f83b9

Please sign in to comment.