Merge branch 'main' into sync

sync
Laurent 8 months ago
commit 800a76ecfd
  1. 13
      tournaments/models/tournament.py
  2. 2
      tournaments/static/misc/required-version.txt
  3. 2
      tournaments/templates/tournaments/navigation_tournament.html

@ -1398,6 +1398,19 @@ class Tournament(BaseModel):
return serializable_match_groups 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: class MatchGroup:
def __init__(self, name, matches, formatted_schedule, round_id=None): def __init__(self, name, matches, formatted_schedule, round_id=None):
self.name = name self.name = name

@ -2,7 +2,7 @@
<a href="{% url 'tournament-info' tournament.id %}" class="topmargin5 orange">Informations</a> <a href="{% url 'tournament-info' tournament.id %}" class="topmargin5 orange">Informations</a>
{% if tournament.display_matches %} {% if tournament.display_matches and tournament.has_bracket %}
<a href="{% url 'tournament-bracket' tournament.id %}" class="topmargin5 orange">Tableau</a> <a href="{% url 'tournament-bracket' tournament.id %}" class="topmargin5 orange">Tableau</a>
{% endif %} {% endif %}

Loading…
Cancel
Save