mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-09 19:40:19 +00:00
Small news improvement and bug fixes
This commit is contained in:
@ -107,6 +107,8 @@ class NewsForm(forms.ModelForm):
|
||||
self.add_error('start_date', ValidationError(_("This field is required.")))
|
||||
if not self.cleaned_data['end_date']:
|
||||
self.add_error('end_date', ValidationError(_("This field is required.")))
|
||||
if self.cleaned_data['start_date'] > self.cleaned_data['end_date']:
|
||||
self.add_error('end_date', ValidationError(_("You crazy? You can not finish an event before starting it.")))
|
||||
if self.cleaned_data['type'] == "WEEKLY" and not self.cleaned_data['until']:
|
||||
self.add_error('until', ValidationError(_("This field is required.")))
|
||||
return self.cleaned_data
|
||||
|
Reference in New Issue
Block a user