|
|
|
|
@ -160,16 +160,7 @@ class Tournament(models.Model): |
|
|
|
|
return "Annulé" |
|
|
|
|
|
|
|
|
|
teams = self.teams() |
|
|
|
|
if self.end_date is not None: |
|
|
|
|
count = self.team_count |
|
|
|
|
if count > 0: |
|
|
|
|
word = "équipe" |
|
|
|
|
if count > 1: |
|
|
|
|
word = word + "s" |
|
|
|
|
return f"{count} {word}" |
|
|
|
|
else: |
|
|
|
|
return None |
|
|
|
|
if self.supposedly_in_progress(): |
|
|
|
|
if self.supposedly_in_progress() or self.end_date is not None: |
|
|
|
|
teams = [t for t in teams if t.stage != "Attente"] |
|
|
|
|
if teams is not None and len(teams) > 0: |
|
|
|
|
word = "équipe" |
|
|
|
|
@ -253,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) |
|
|
|
|
@ -312,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") |
|
|
|
|
|