1
0
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:
Yohann D'ANELLO
2020-03-30 17:35:47 +02:00
parent fcb4da2db3
commit b0b3aa35a9
5 changed files with 98 additions and 80 deletions

View File

@ -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,