From 4fbbda02e290ac68f89447de7e3a90290fe49ffe Mon Sep 17 00:00:00 2001 From: Laurent Date: Fri, 6 Dec 2024 15:30:45 +0100 Subject: [PATCH] add logs --- tournaments/models/tournament.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 97e6172..50add08 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -606,7 +606,7 @@ class Tournament(models.Model): matches.extend(first_round.get_matches_recursive(True)) else: current_round = self.round_to_show() - print(f'current_round = {current_round.index}') + print(f'current_round = {current_round.index} / parent = {current_round.parent}') if current_round: all_upper_matches_are_over = current_round.all_matches_are_over() if all_upper_matches_are_over is False: @@ -679,11 +679,13 @@ class Tournament(models.Model): last_started_match = self.first_unfinished_match() if last_started_match: current_round = last_started_match.round.root_round() + print(f'round_to_show > current_round: {current_round.name()}') if current_round: return current_round main_rounds = list(self.round_set.filter(parent=None).all()) main_rounds.sort(key=lambda r: r.index) if main_rounds: + print(f'round_to_show > main_rounds: {main_rounds[0].name()}') return main_rounds[0] else: return None