1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-20 17:41:55 +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

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

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,

View File

@ -10,8 +10,6 @@ from django.db import models
from django.utils.translation import gettext_lazy as _
from polymorphic.models import PolymorphicModel
from member.models import Club
"""
Defines each note types
"""