mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2024-12-25 07:02:22 +00:00
Only consider a participant as a child if it is not 18 on the beginning of the tournament
This commit is contained in:
parent
a0266c691b
commit
4dd3c105fe
@ -159,7 +159,13 @@ class ParticipantRegistration(Registration):
|
||||
|
||||
@property
|
||||
def under_18(self):
|
||||
return (timezone.now().date() - self.birth_date).days < 18 * 365.24
|
||||
important_date = timezone.now().date()
|
||||
if self.team and self.team.participation.tournament:
|
||||
important_date = self.team.participation.tournament.date_start
|
||||
if self.team.participation.final:
|
||||
from participation.models import Tournament
|
||||
important_date = Tournament.final_tournament().date_start
|
||||
return (important_date - self.birth_date).days < 18 * 365.24
|
||||
|
||||
@property
|
||||
def type(self): # pragma: no cover
|
||||
|
Loading…
Reference in New Issue
Block a user