|
|
|
|
@ -180,37 +180,45 @@ class Match(models.Model): |
|
|
|
|
|
|
|
|
|
if len(team_scores) == 0: |
|
|
|
|
if (self.round and self.round.parent is None and self.round.tournament.round_set.filter(parent__isnull=True, group_stage_loser_bracket=False).count() - 1 == self.round.index): |
|
|
|
|
names = ["Qualifié", ''] |
|
|
|
|
names = ["Qualifié"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
names = ["Qualifié", ''] |
|
|
|
|
names = ["Qualifié"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
return teams |
|
|
|
|
if (self.group_stage): |
|
|
|
|
names = ["Équipe de poule", ''] |
|
|
|
|
names = ["Équipe de poule"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
names = ["Équipe de poule", ''] |
|
|
|
|
names = ["Équipe de poule"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
return teams |
|
|
|
|
elif self.round and self.round.parent: |
|
|
|
|
if loser_top_match: |
|
|
|
|
names = [f"Perdant {loser_top_match.computed_name()}", ''] |
|
|
|
|
names = [f"Perdant {loser_top_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
if loser_bottom_match: |
|
|
|
|
names = [f"Perdant {loser_bottom_match.computed_name()}", ''] |
|
|
|
|
names = [f"Perdant {loser_bottom_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
if previous_top_match: |
|
|
|
|
names = [f"Gagnant {previous_top_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
if previous_bottom_match: |
|
|
|
|
names = [f"Gagnant {previous_bottom_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
elif self.round and self.round.parent is None: |
|
|
|
|
if previous_top_match: |
|
|
|
|
names = [f"Gagnant {previous_top_match.computed_name()}", ''] |
|
|
|
|
names = [f"Gagnant {previous_top_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
if previous_bottom_match: |
|
|
|
|
names = [f"Gagnant {previous_bottom_match.computed_name()}", ''] |
|
|
|
|
names = [f"Gagnant {previous_bottom_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
elif len(team_scores) == 1: |
|
|
|
|
@ -218,33 +226,33 @@ class Match(models.Model): |
|
|
|
|
existing_team = team_scores[0].live_team(self) |
|
|
|
|
if (self.group_stage): |
|
|
|
|
teams.append(existing_team) |
|
|
|
|
names = ["Équipe de poule", ''] |
|
|
|
|
names = ["Équipe de poule"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
elif self.round: |
|
|
|
|
if loser_top_match and loser_top_match.disabled == False and loser_top_match.end_date is None: |
|
|
|
|
names = [f"Perdant {loser_top_match.computed_name()}", ''] |
|
|
|
|
names = [f"Perdant {loser_top_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
teams.append(existing_team) |
|
|
|
|
elif loser_bottom_match: |
|
|
|
|
names = [f"Perdant {loser_bottom_match.computed_name()}", ''] |
|
|
|
|
names = [f"Perdant {loser_bottom_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(existing_team) |
|
|
|
|
teams.append(team) |
|
|
|
|
elif previous_top_match and previous_top_match.disabled == False and previous_top_match.end_date is None: |
|
|
|
|
names = [f"Gagnant {previous_top_match.computed_name()}", ''] |
|
|
|
|
names = [f"Gagnant {previous_top_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(team) |
|
|
|
|
teams.append(existing_team) |
|
|
|
|
elif previous_bottom_match: |
|
|
|
|
names = [f"Gagnant {previous_bottom_match.computed_name()}", ''] |
|
|
|
|
names = [f"Gagnant {previous_bottom_match.computed_name()}"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
teams.append(existing_team) |
|
|
|
|
teams.append(team) |
|
|
|
|
elif (self.round.parent is None and self.round.tournament.round_set.filter(parent__isnull=True, group_stage_loser_bracket=False).count() - 1 == self.round.index): |
|
|
|
|
match_index_within_round = self.index - (int(2 ** self.round.index) - 1) |
|
|
|
|
names = ["Qualifié", ''] |
|
|
|
|
names = ["Qualifié"] |
|
|
|
|
team = self.default_live_team(names) |
|
|
|
|
if match_index_within_round < int(2 ** self.round.index) / 2: |
|
|
|
|
teams.append(existing_team) |
|
|
|
|
|