diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 1541ea6..45711d7 100644 --- a/tournaments/models/tournament.py +++ b/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) - team.set_stage("Attente") + 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,10 +309,12 @@ class Tournament(models.Model): group_stage_teams.sort(key=lambda s: s.weight) for team in bracket_teams: - team.set_stage("Tableau") + if team.stage == "Attente": + team.set_stage("Tableau") for team in group_stage_teams: - team.set_stage("Poule") + if team.stage == "Attente": + team.set_stage("Poule") for team in waiting_teams: team.set_stage("Attente")