diff --git a/tournaments/models/__init__.py b/tournaments/models/__init__.py index ced18b9..ff8321d 100644 --- a/tournaments/models/__init__.py +++ b/tournaments/models/__init__.py @@ -5,7 +5,7 @@ from .date_interval import DateInterval from .enums import TournamentPayment, FederalCategory, FederalLevelCategory, FederalAgeCategory, FederalMatchCategory from .player_enums import PlayerSexType, PlayerDataSource, PlayerPaymentType from .event import Event -from .tournament import Tournament, TeamSummon, TeamSortingType, TeamList +from .tournament import Tournament, TeamSummon, TeamSortingType, TeamItem from .group_stage import GroupStage from .round import Round from .match import Match, LiveMatch diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index 7736713..51b7d3f 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.py @@ -90,3 +90,10 @@ class TeamRegistration(models.Model): return self.weight else: return self.locked_weight + + def local_call_date(self): + timezone = self.tournament.timezone() + if self.call_date: + return self.call_date.astimezone(timezone) + else: + return None diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 2fde8c6..a46b033 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -299,7 +299,7 @@ class Tournament(models.Model): # print(f"Is valid: {is_valid}") if team_registration.walk_out is False: - team = TeamList(team_registration) + team = TeamItem(team_registration) # print(f"Created team: {team}") if team_registration.group_stage_position is not None: team.set_stage("Poule") @@ -880,10 +880,10 @@ class TeamSummon: "image": self.image, } -class TeamList: +class TeamItem: def __init__(self, team_registration): self.names = team_registration.team_names - self.date = team_registration.call_date + self.date = team_registration.local_call_date() self.weight = team_registration.weight self.initial_weight = team_registration.initial_weight() self.image = team_registration.logo