Fix relationship naming

sync
Laurent 8 months ago
parent e94d325668
commit c285bb1a03
  1. 8
      tournaments/models/round.py

@ -107,16 +107,16 @@ class Round(SideStoreModel):
return True
def prepare_match_group(self, next_round, parent_round, loser_final, double_butterfly_mode):
matches = self.match_set.filter(disabled=False).order_by('index')
matches = self.matches.filter(disabled=False).order_by('index')
if len(matches) == 0:
return None
if next_round:
next_round_matches = next_round.match_set.filter(disabled=False).order_by('index')
next_round_matches = next_round.matches.filter(disabled=False).order_by('index')
else:
next_round_matches = []
if len(matches) < len(next_round_matches):
all_matches = self.match_set.order_by('index')
all_matches = self.matches.order_by('index')
filtered_matches = []
# Process matches in pairs
@ -152,7 +152,7 @@ class Round(SideStoreModel):
else:
first_half_matches = list(matches) # Convert QuerySet to a list
if self.index == 0 and loser_final:
loser_match = loser_final.match_set.first()
loser_match = loser_final.matches.first()
if loser_match:
first_half_matches.append(loser_match)

Loading…
Cancel
Save