Fix user age calculation and handle 'N/A' birth year

main
Razmig Sarkissian 4 weeks ago
parent 3b56d59321
commit 6918677009
  1. 8
      tournaments/models/tournament.py
  2. 2
      tournaments/static/rankings/CLASSEMENT-PADEL-DAMES-10-2025.csv
  3. 2
      tournaments/static/rankings/CLASSEMENT-PADEL-MESSIEURS-10-2025.csv
  4. 2
      tournaments/templates/tournaments/tournament_info.html

@ -1525,7 +1525,13 @@ class Tournament(BaseModel):
if is_woman is not None and self.federal_category == FederalCategory.WOMEN and is_woman is False:
reasons.append("Ce tournoi est réservé aux femmes")
if birth_year is None:
if birth_year is None or birth_year == 'N/A':
return reasons if reasons else None
try:
tournament_start_year = self.season_year()
user_age = tournament_start_year - int(birth_year)
except (ValueError, TypeError):
return reasons if reasons else None
tournament_start_year = self.season_year()

@ -1,4 +1,4 @@
anonymous-players:5638
anonymous-players:5459
max-players:16148
unrank-male-value:14060
;1;COLLOMBON;Alix;FRA;1244033;0;Non;0;OCCITANIE;60 31 0803;STADE TOULOUSAIN TENNIS PADEL;0;;1993;

Can't render this file because it is too large.

@ -1,4 +1,4 @@
anonymous-players:5638
anonymous-players:5459
max-players:110960
unrank-male-value:92341
;1;ZAPATA PIZZARO;Teodoro Victor;ESP;2098059;4545;Oui;7;ILE DE FRANCE;57 93 0505;AS PADEL AFICIONADOS;0;;1995;

Can't render this file because it is too large.

@ -164,7 +164,7 @@
{% else %}
<div class="topmargin20">
<p class="minor info">
La désincription en ligne n'est plus possible. Veuillez contacter directement le juge-arbitre si besoin.
La désinscription en ligne n'est plus possible. Veuillez contacter directement le juge-arbitre si besoin.
</p>
</div>
{% endif %}

Loading…
Cancel
Save