mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-26 18:37:12 +00:00
Users can create a past activity
This commit is contained in:
parent
8ac551e1bc
commit
48eb0749e0
@ -15,12 +15,6 @@ from .models import Activity, Guest
|
|||||||
|
|
||||||
|
|
||||||
class ActivityForm(forms.ModelForm):
|
class ActivityForm(forms.ModelForm):
|
||||||
def clean_date_start(self):
|
|
||||||
date_start = self.cleaned_data["date_start"]
|
|
||||||
if not self.instance.pk and date_start < timezone.now():
|
|
||||||
self.add_error("date_start", _("You can't create a past activity."))
|
|
||||||
return date_start
|
|
||||||
|
|
||||||
def clean_date_end(self):
|
def clean_date_end(self):
|
||||||
date_end = self.cleaned_data["date_end"]
|
date_end = self.cleaned_data["date_end"]
|
||||||
date_start = self.cleaned_data["date_start"]
|
date_start = self.cleaned_data["date_start"]
|
||||||
|
@ -23,10 +23,6 @@ msgstr ""
|
|||||||
msgid "activity"
|
msgid "activity"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: apps/activity/forms.py:21
|
|
||||||
msgid "You can't create a past activity."
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: apps/activity/forms.py:28 apps/activity/models.py:127
|
#: apps/activity/forms.py:28 apps/activity/models.py:127
|
||||||
msgid "The end date must be after the start date."
|
msgid "The end date must be after the start date."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -23,10 +23,6 @@ msgstr ""
|
|||||||
msgid "activity"
|
msgid "activity"
|
||||||
msgstr "activité"
|
msgstr "activité"
|
||||||
|
|
||||||
#: apps/activity/forms.py:21
|
|
||||||
msgid "You can't create a past activity."
|
|
||||||
msgstr "Vous ne pouvez pas créer une activité dans le passé."
|
|
||||||
|
|
||||||
#: apps/activity/forms.py:28 apps/activity/models.py:127
|
#: apps/activity/forms.py:28 apps/activity/models.py:127
|
||||||
msgid "The end date must be after the start date."
|
msgid "The end date must be after the start date."
|
||||||
msgstr "La date de fin doit être après celle de début."
|
msgstr "La date de fin doit être après celle de début."
|
||||||
|
Loading…
Reference in New Issue
Block a user