From 070b1349057d1688271b7f5e66fc961b673e7680 Mon Sep 17 00:00:00 2001 From: Laurent Date: Fri, 6 Dec 2024 16:09:53 +0100 Subject: [PATCH] Fix round to show --- tournaments/models/tournament.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 38b1d39..d0834cc 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -689,12 +689,12 @@ class Tournament(models.Model): # all started matches have ended, possibly last_finished_match = self.last_finished_match() print(f'last_finished_match = {last_finished_match.name}') - round_index = last_finished_match.round.index - print(f'round_index = {round_index}') - if round_index == 0: + round_root_index = last_finished_match.round.root_round().index + print(f'round_index = {round_root_index}') + if round_root_index == 0: return last_finished_match.round else: - round = self.round_set.filter(parent=None,index=round_index-1).first() + round = self.round_set.filter(parent=None,index=round_root_index-1).first() if round: return round else: