diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 3f9ec6b..77dc6a5 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -1398,6 +1398,19 @@ class Tournament(BaseModel): 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/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 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 %}