From c285bb1a033a0ca4b3fbaa2af63656073c594fb9 Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 13 Mar 2025 14:24:19 +0100 Subject: [PATCH] Fix relationship naming --- tournaments/models/round.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tournaments/models/round.py b/tournaments/models/round.py index 54d1c62..352435b 100644 --- a/tournaments/models/round.py +++ b/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)