From 39d8b2a8c1b1acca8d425fe9085c7a2675bdf4db Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Sun, 17 Dec 2023 15:29:04 +0100 Subject: [PATCH] =?UTF-8?q?On=20supprime=20la=20contrainte=20de=20date=20p?= =?UTF-8?q?our=20permettre=20des=20imports=20ou=20manipulation=20d'=C3=A9v?= =?UTF-8?q?=C3=A9nements=20m=C3=AAme=20dans=20le=20pass=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/forms.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/agenda_culturel/forms.py b/src/agenda_culturel/forms.py index 8a2f0da..b9149a2 100644 --- a/src/agenda_culturel/forms.py +++ b/src/agenda_culturel/forms.py @@ -29,23 +29,12 @@ class EventForm(ModelForm): del self.fields['status'] - def clean_start_day(self): - start_day = self.cleaned_data.get("start_day") - - if start_day is not None and start_day < date.today(): - raise ValidationError(_("The start date cannot be earler than today.")) - - return start_day - - def clean_end_day(self): start_day = self.cleaned_data.get("start_day") end_day = self.cleaned_data.get("end_day") if end_day is not None and start_day is not None and end_day < start_day: raise ValidationError(_("The end date must be after the start date.")) - if end_day is not None and end_day < date.today(): - raise ValidationError(_("The end date cannot be earler than today.")) return end_day