fix LB sorting

online_registration
Raz 1 year ago
parent dc683b0762
commit ab37b7b189
  1. 2
      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))

Loading…
Cancel
Save