Users can create a past activity
This commit is contained in:
parent
8ac551e1bc
commit
48eb0749e0
3 changed files with 0 additions and 14 deletions
|
|
@ -15,12 +15,6 @@ from .models import Activity, Guest
|
|||
|
||||
|
||||
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):
|
||||
date_end = self.cleaned_data["date_end"]
|
||||
date_start = self.cleaned_data["date_start"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue