1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-27 20:22:15 +02:00

Merge branch 'documents' into beta

This commit is contained in:
Pierre-antoine Comby
2020-08-19 13:18:12 +02:00
13 changed files with 143 additions and 88 deletions

View File

@ -54,6 +54,15 @@ class ActivityForm(forms.ModelForm):
class GuestForm(forms.ModelForm):
def clean(self):
"""
Someone can be invited as a Guest to an Activity if:
- the activity has not already started.
- the activity is validated.
- the Guest has not already been invited more than 5 times.
- the Guest is already invited.
- the inviter already invited 3 peoples.
"""
cleaned_data = super().clean()
if timezone.now() > timezone.localtime(self.activity.date_start):