1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-02-22 18:21:22 +00:00

Compare commits

..

No commits in common. "4dd3c105fe1ba23f357cc87fbbba27c2db773d5a" and "b5136ffa915f94d18408ac0adf90872c1b9b6a1c" have entirely different histories.

2 changed files with 2 additions and 8 deletions

View File

@ -391,7 +391,7 @@ class TeamAuthorizationsView(LoginRequiredMixin, DetailView):
_("Parental authorization of {participant}.{ext}") _("Parental authorization of {participant}.{ext}")
.format(participant=str(participant), ext=ext)) .format(participant=str(participant), ext=ext))
if isinstance(participant, StudentRegistration) and participant.health_sheet: if participant.health_sheet:
mime_type = magic.from_file("media/" + participant.health_sheet.name) mime_type = magic.from_file("media/" + participant.health_sheet.name)
ext = mime_type.split("/")[1].replace("jpeg", "jpg") ext = mime_type.split("/")[1].replace("jpeg", "jpg")
zf.write("media/" + participant.health_sheet.name, zf.write("media/" + participant.health_sheet.name,

View File

@ -159,13 +159,7 @@ class ParticipantRegistration(Registration):
@property @property
def under_18(self): def under_18(self):
important_date = timezone.now().date() return (timezone.now().date() - self.birth_date).days < 18 * 365.24
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 @property
def type(self): # pragma: no cover def type(self): # pragma: no cover