diff --git a/tournaments/models/round.py b/tournaments/models/round.py index f1b47f0..a7dee08 100644 --- a/tournaments/models/round.py +++ b/tournaments/models/round.py @@ -68,7 +68,7 @@ class Round(models.Model): # Recursively fetch matches from child rounds # Sort children by depth in ascending order (deeper rounds last) - sorted_children = sorted(self.children.all(), key=lambda child: child.get_depth()) + sorted_children = sorted(self.children.all(), key=lambda child: (child.index, child.get_depth())) for child_round in sorted_children: matches.extend(child_round.get_matches_recursive(hide_empty_matches))