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