|
|
|
|
@ -518,12 +518,12 @@ class Tournament(BaseModel): |
|
|
|
|
groups = [] |
|
|
|
|
|
|
|
|
|
if self.display_matches(): |
|
|
|
|
rounds = self.rounds.filter(parent=None, group_stage_loser_bracket=False).all().order_by('index').prefetch_related('matches') |
|
|
|
|
rounds = self.rounds.filter(parent=None, group_stage_loser_bracket=False).all().order_by('index').prefetch_related('matches', 'matches__team_scores', 'matches__team_scores__team_registration', 'matches__team_scores__team_registration__player_registrations') |
|
|
|
|
for round in rounds: |
|
|
|
|
groups.extend(self.round_match_groups(round, broadcasted, hide_empty_matches=True)) |
|
|
|
|
|
|
|
|
|
if self.display_group_stages(): |
|
|
|
|
rounds = self.rounds.filter(parent=None, group_stage_loser_bracket=True).all().order_by('index').prefetch_related('matches') |
|
|
|
|
rounds = self.rounds.filter(parent=None, group_stage_loser_bracket=True).all().order_by('index').prefetch_related('matches', 'matches__team_scores', 'matches__team_scores__team_registration', 'matches__team_scores__team_registration__player_registrations') |
|
|
|
|
for round in rounds: |
|
|
|
|
groups.extend(self.round_match_groups(round, broadcasted, hide_empty_matches=True)) |
|
|
|
|
|
|
|
|
|
@ -610,7 +610,7 @@ class Tournament(BaseModel): |
|
|
|
|
|
|
|
|
|
def sorted_group_stages(self): |
|
|
|
|
# Get all group stages and sort by step (descending) and index (ascending) |
|
|
|
|
group_stages = self.group_stages.all().order_by('-step', 'index').prefetch_related('matches') |
|
|
|
|
group_stages = self.group_stages.all().order_by('-step', 'index').prefetch_related('matches', 'matches__team_scores', 'matches__team_scores__team_registration', 'matches__team_scores__team_registration__player_registrations') |
|
|
|
|
|
|
|
|
|
# List to collect live group stages from finished steps |
|
|
|
|
filtered = [] |
|
|
|
|
|