diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 100ffce..eb76030 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -124,7 +124,10 @@ class Tournament(models.Model): else: return None - def team_count_display(self): + def tournament_status_display(self): + if self.is_canceled: + return "Annulé" + teams = self.teams() if teams is not None and len(teams) > 0: return f"{len(teams)} inscriptions" diff --git a/tournaments/templates/tournaments/tournament_row.html b/tournaments/templates/tournaments/tournament_row.html index 1a64ac0..8cd564f 100644 --- a/tournaments/templates/tournaments/tournament_row.html +++ b/tournaments/templates/tournaments/tournament_row.html @@ -22,13 +22,13 @@ {% endif %} - {% if tournament.team_count_display %} -
{{ tournament.team_count_display }}
+ {% if tournament.tournament_status_display %} +
{{ tournament.tournament_status_display }}
{% endif %}
{{ tournament.formatted_start_date }}
- {% if tournament.team_count_display %} -
{{ tournament.team_count_display }}
+ {% if tournament.tournament_status_display %} +
{{ tournament.tournament_status_display }}
{% endif %}