|
|
|
@ -194,13 +194,14 @@ class Match(TournamentSubModel): |
|
|
|
teams = [] |
|
|
|
teams = [] |
|
|
|
|
|
|
|
|
|
|
|
# Check if team scores exist |
|
|
|
# Check if team scores exist |
|
|
|
|
|
|
|
team_scores_count = self.team_scores.count() |
|
|
|
team_scores = list(self.team_scores.all()) |
|
|
|
team_scores = list(self.team_scores.all()) |
|
|
|
previous_top_match = self.precedent_match(True) |
|
|
|
previous_top_match = self.precedent_match(True) |
|
|
|
previous_bottom_match = self.precedent_match(False) |
|
|
|
previous_bottom_match = self.precedent_match(False) |
|
|
|
loser_top_match = self.loser_precedent_match(True) |
|
|
|
loser_top_match = self.loser_precedent_match(True) |
|
|
|
loser_bottom_match = self.loser_precedent_match(False) |
|
|
|
loser_bottom_match = self.loser_precedent_match(False) |
|
|
|
|
|
|
|
|
|
|
|
if len(team_scores) == 0 or hide_names is True: |
|
|
|
if team_scores_count == 0 or hide_names is True: |
|
|
|
|
|
|
|
|
|
|
|
if (self.round and self.round.parent is None and self.round.tournament.rounds.filter(parent__isnull=True, group_stage_loser_bracket=False).count() - 1 == self.round.index): |
|
|
|
if (self.round and self.round.parent is None and self.round.tournament.rounds.filter(parent__isnull=True, group_stage_loser_bracket=False).count() - 1 == self.round.index): |
|
|
|
names = ["Qualifié"] |
|
|
|
names = ["Qualifié"] |
|
|
|
@ -248,7 +249,7 @@ class Match(TournamentSubModel): |
|
|
|
names = [f"Gagnant {previous_bottom_match.computed_name()}"] |
|
|
|
names = [f"Gagnant {previous_bottom_match.computed_name()}"] |
|
|
|
team = self.default_live_team(names) |
|
|
|
team = self.default_live_team(names) |
|
|
|
teams.append(team) |
|
|
|
teams.append(team) |
|
|
|
elif len(team_scores) == 1: |
|
|
|
elif team_scores_count == 1: |
|
|
|
# Only one team score, handle missing one |
|
|
|
# Only one team score, handle missing one |
|
|
|
existing_team = team_scores[0].live_team(self, short_names=short_names) |
|
|
|
existing_team = team_scores[0].live_team(self, short_names=short_names) |
|
|
|
if (self.group_stage): |
|
|
|
if (self.group_stage): |
|
|
|
@ -288,7 +289,7 @@ class Match(TournamentSubModel): |
|
|
|
teams.append(team) |
|
|
|
teams.append(team) |
|
|
|
teams.append(existing_team) |
|
|
|
teams.append(existing_team) |
|
|
|
|
|
|
|
|
|
|
|
elif len(team_scores) == 2: |
|
|
|
elif team_scores_count: |
|
|
|
# Both team scores present |
|
|
|
# Both team scores present |
|
|
|
teams.extend([team_score.live_team(self, short_names=short_names) for team_score in team_scores]) |
|
|
|
teams.extend([team_score.live_team(self, short_names=short_names) for team_score in team_scores]) |
|
|
|
|
|
|
|
|
|
|
|
|