diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index f787a80..00dde56 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -234,25 +234,9 @@ class Tournament(BaseModel): def get_tournament_status(self): return self.get_online_registration_status().status_localized() - def tournament_status_display(self): - teams = self.teams(True) - if self.supposedly_in_progress() or self.end_date is not None or self.should_be_over(): - teams = [t for t in teams if t.stage != "Attente"] - if teams is not None and len(teams) > 0: - word = "équipe" - if len(teams) > 1: - word = word + "s" - return f"{len(teams)} {word}" - else: - return None - - if teams is not None and len(teams) > 0: - word = "inscription" - if len(teams) > 1: - word = word + "s" - return f"{len(teams)} {word}" - else: - return None + def get_tournament_status_team_count(self): + active_teams_count = self.team_registrations.filter(walk_out=False).count() + return min(active_teams_count, self.team_count) def name_and_event(self): event_name = None diff --git a/tournaments/templates/tournaments/tournament_row.html b/tournaments/templates/tournaments/tournament_row.html index e9eba85..2722441 100644 --- a/tournaments/templates/tournaments/tournament_row.html +++ b/tournaments/templates/tournaments/tournament_row.html @@ -22,7 +22,7 @@