mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
Display a form error rather than a page error if a guest is already invited
This commit is contained in:
@ -257,7 +257,7 @@ class Guest(models.Model):
|
||||
last_name__iexact=self.last_name,
|
||||
activity__date_start__gte=self.activity.date_start - one_year,
|
||||
)
|
||||
if qs.count() >= 5:
|
||||
if qs.filter(entry__isnull=False).count() >= 5:
|
||||
raise ValidationError(_("This person has been already invited 5 times this year."))
|
||||
|
||||
qs = qs.filter(activity=self.activity)
|
||||
|
Reference in New Issue
Block a user