From fe7713cb892b64dacc31d18ec24a5d2b317013f2 Mon Sep 17 00:00:00 2001 From: Raz Date: Mon, 24 Mar 2025 11:44:05 +0100 Subject: [PATCH 1/2] fix hiding bracket if no bracket --- tournaments/models/tournament.py | 13 +++++++++++++ .../tournaments/navigation_tournament.html | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 2d6ba1f..b8400fc 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -1382,6 +1382,19 @@ class Tournament(models.Model): return serializable_match_groups + def has_bracket(self): + main_rounds = self.round_set.filter( + parent=None, + group_stage_loser_bracket=False + ) + + count = main_rounds.count() + if count == 0: + return False + else: + return True + + class MatchGroup: def __init__(self, name, matches, formatted_schedule, round_id=None): self.name = name diff --git a/tournaments/templates/tournaments/navigation_tournament.html b/tournaments/templates/tournaments/navigation_tournament.html index fd5995f..332d7c9 100644 --- a/tournaments/templates/tournaments/navigation_tournament.html +++ b/tournaments/templates/tournaments/navigation_tournament.html @@ -2,7 +2,7 @@ Informations - {% if tournament.display_matches %} + {% if tournament.display_matches and tournament.has_bracket %} Tableau {% endif %} From e75772f361094cae4fd0f03917fa32d5e705498c Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 24 Mar 2025 15:56:56 +0100 Subject: [PATCH 2/2] upgrade required version to 1.2 --- tournaments/static/misc/required-version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tournaments/static/misc/required-version.txt b/tournaments/static/misc/required-version.txt index 49d5957..5625e59 100644 --- a/tournaments/static/misc/required-version.txt +++ b/tournaments/static/misc/required-version.txt @@ -1 +1 @@ -0.1 +1.2