mirror of
https://github.com/ae-utbm/sith.git
synced 2024-12-22 15:51:19 +00:00
Merge branch 'fix-news-form' into 'master'
Fix 500 when a news needs a start_date and/or end_date but we don't provide See merge request ae/Sith!252
This commit is contained in:
commit
2f1b26053b
@ -230,7 +230,11 @@ class NewsForm(forms.ModelForm):
|
||||
self.add_error(
|
||||
"end_date", ValidationError(_("This field is required."))
|
||||
)
|
||||
if self.cleaned_data["start_date"] > self.cleaned_data["end_date"]:
|
||||
if (
|
||||
not self.has_error("start_date")
|
||||
and not self.has_error("end_date")
|
||||
and self.cleaned_data["start_date"] > self.cleaned_data["end_date"]
|
||||
):
|
||||
self.add_error(
|
||||
"end_date",
|
||||
ValidationError(
|
||||
|
Loading…
Reference in New Issue
Block a user