diff --git a/tournaments/models/round.py b/tournaments/models/round.py index d4d773e..1f5d43a 100644 --- a/tournaments/models/round.py +++ b/tournaments/models/round.py @@ -55,8 +55,10 @@ class Round(TournamentSubModel): return name def ranking_matches(self, hide_empty_matches): + + children_with_matches = self.children.prefetch_related('matches') matches = [] - for child in self.children.all(): + for child in children_with_matches: child_matches = child.matches.all() if hide_empty_matches: