mirror of
https://github.com/ae-utbm/sith.git
synced 2024-10-31 19:38:04 +00:00
Fix 500 on news creation/edition
This commit is contained in:
parent
42f5773f51
commit
60c9498a56
@ -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