clubs
Laurent 2 years ago
parent ee7f1f8861
commit b73f6985a6
  1. 10
      tournaments/models/tournament.py

@ -56,13 +56,13 @@ class Tournament(models.Model):
def team_summons(self):
summons = []
for team_registration in self.teamregistration_set.all():
match = None
match = team_registration.next_match()
if match:
next_match = team_registration.next_match()
if next_match:
print(f"MATCH ID = {next_match.id}")
names = team_registration.team_names()
stage = match.stage_name()
stage = next_match.stage_name()
weight = team_registration.weight()
summon = TeamSummon(names, match.start_date, weight, stage, team_registration.logo)
summon = TeamSummon(names, next_match.start_date, weight, stage, team_registration.logo)
summons.append(summon)
summons.sort(key=lambda s: s.weight)

Loading…
Cancel
Save