From 79b857f7c96e75b273c16cee462bdd2404ee2662 Mon Sep 17 00:00:00 2001 From: Razmig Sarkissian Date: Sun, 17 Aug 2025 08:54:14 +0200 Subject: [PATCH] Fix age calculation to use tournament start date --- tournaments/models/tournament.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index a31e742..4a98cc5 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -1420,11 +1420,11 @@ class Tournament(BaseModel): if birth_year is None: return reasons if reasons else None - current_year = timezone.now().year - if timezone.now().month >= 9: # Check if current month is September or later - current_year += 1 + tournament_start_year = self.start_date.year + if self.start_date.month >= 9: # Check if tournament start month is September or later + tournament_start_year += 1 - user_age = current_year - int(birth_year) + user_age = tournament_start_year - int(birth_year) # Check age category restrictions if self.federal_age_category == FederalAgeCategory.A11_12 and user_age > 12: