Laurent 1 year ago
commit 74d2a0d94f
  1. 8
      tournaments/models/tournament.py

@ -244,7 +244,13 @@ class Tournament(models.Model):
initial_weight = team_registration.initial_weight()
date = team_registration.registration_date
team = TeamList(names, weight, date, initial_weight, team_registration.logo)
if team_registration.group_stage_position is not None:
team.set_stage("Poule")
elif team_registration.bracket_position is not None:
team.set_stage("Tableau")
else:
team.set_stage("Attente")
teams.append(team)
if team_registration.wild_card_bracket:
wildcard_bracket.append(team)
@ -303,9 +309,11 @@ class Tournament(models.Model):
group_stage_teams.sort(key=lambda s: s.weight)
for team in bracket_teams:
if team.stage == "Attente":
team.set_stage("Tableau")
for team in group_stage_teams:
if team.stage == "Attente":
team.set_stage("Poule")
for team in waiting_teams:

Loading…
Cancel
Save