1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-07-04 04:12:08 +02:00

Birth date is only for participants

This commit is contained in:
Emmy D'Anello
2023-01-10 20:31:43 +01:00
parent 63a10c1be5
commit 0f176ea4c6
9 changed files with 252 additions and 109 deletions

View File

@ -123,11 +123,6 @@ class ParticipantRegistration(Registration):
verbose_name=_("team"),
)
birth_date = models.DateField(
verbose_name=_("birth date"),
default=date.today,
)
gender = models.CharField(
max_length=6,
verbose_name=_("gender"),
@ -174,6 +169,8 @@ class ParticipantRegistration(Registration):
@property
def under_18(self):
if isinstance(self, CoachRegistration):
return False # In normal case
important_date = timezone.now().date()
if self.team and self.team.participation.tournament:
important_date = self.team.participation.tournament.date_start
@ -196,6 +193,11 @@ class StudentRegistration(ParticipantRegistration):
Specific registration for students.
They have a team, a student class and a school.
"""
birth_date = models.DateField(
verbose_name=_("birth date"),
default=date.today,
)
student_class = models.IntegerField(
choices=[
(12, _("12th grade")),
@ -218,7 +220,7 @@ class StudentRegistration(ParticipantRegistration):
responsible_phone = PhoneNumberField(
verbose_name=_("responsible phone number"),
blank=True,
default="",
)
responsible_email = models.EmailField(