diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 37c0a0d..aec42e4 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -448,11 +448,12 @@ class Tournament(BaseModel): groups = [] if self.display_matches(): - for round in self.rounds.filter(parent=None, group_stage_loser_bracket=False).all().order_by('index'): + rounds = self.rounds.filter(parent=None, group_stage_loser_bracket=False).all().order_by('index') + for round in rounds: groups.extend(self.round_match_groups(round, broadcasted, hide_empty_matches=True)) if self.display_group_stages(): - for round in self.rounds.all().order_by('index'): + for round in self.round_set.filter(parent=None, group_stage_loser_bracket=True).all().order_by('index'): groups.extend(self.round_match_groups(round, broadcasted, hide_empty_matches=True)) group_stages = sorted(self.sorted_group_stages(), key=lambda s: (-s.step, s.index))