Raz 1 year ago
commit c45b44fbf8
  1. 2
      tournaments/models/__init__.py
  2. 7
      tournaments/models/team_registration.py
  3. 6
      tournaments/models/tournament.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

@ -94,3 +94,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

@ -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")
@ -884,10 +884,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

Loading…
Cancel
Save