mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Guests can't be invited if the activity is not validated
This commit is contained in:
@ -44,6 +44,9 @@ class GuestForm(forms.ModelForm):
|
||||
if self.activity.date_start > datetime.now():
|
||||
self.add_error("inviter", _("You can't invite someone once the activity is started."))
|
||||
|
||||
if not self.activity.valid:
|
||||
self.add_error("inviter", _("This activity is not validated yet."))
|
||||
|
||||
one_year = timedelta(days=365)
|
||||
|
||||
qs = Guest.objects.filter(
|
||||
|
@ -216,6 +216,9 @@ class Guest(models.Model):
|
||||
if self.activity.date_start > datetime.now():
|
||||
raise ValidationError(_("You can't invite someone once the activity is started."))
|
||||
|
||||
if not self.activity.valid:
|
||||
raise ValidationError(_("This activity is not validated yet."))
|
||||
|
||||
qs = Guest.objects.filter(
|
||||
first_name=self.first_name,
|
||||
last_name=self.last_name,
|
||||
|
Reference in New Issue
Block a user