From 56e391799907b8e386a809ed8c9516c277c8d8ed Mon Sep 17 00:00:00 2001 From: Laurent Date: Wed, 26 Feb 2025 14:36:52 +0100 Subject: [PATCH] fix match group display --- tournaments/models/tournament.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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))