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): def team_summons(self):
summons = [] summons = []
for team_registration in self.teamregistration_set.all(): for team_registration in self.teamregistration_set.all():
match = None next_match = team_registration.next_match()
match = team_registration.next_match() if next_match:
if match: print(f"MATCH ID = {next_match.id}")
names = team_registration.team_names() names = team_registration.team_names()
stage = match.stage_name() stage = next_match.stage_name()
weight = team_registration.weight() 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.append(summon)
summons.sort(key=lambda s: s.weight) summons.sort(key=lambda s: s.weight)

Loading…
Cancel
Save