diff --git a/tournaments/models/enums.py b/tournaments/models/enums.py index 1ed426c..0ee32ce 100644 --- a/tournaments/models/enums.py +++ b/tournaments/models/enums.py @@ -123,7 +123,7 @@ class OnlineRegistrationStatus(models.IntegerChoices): status_map = { OnlineRegistrationStatus.OPEN: "Inscription ouverte", OnlineRegistrationStatus.NOT_ENABLED: "Inscription désactivée", - OnlineRegistrationStatus.NOT_STARTED: "Inscription pas encore ouverte", + OnlineRegistrationStatus.NOT_STARTED: "Ouverture des inscriptions à venir", OnlineRegistrationStatus.ENDED: "Inscription terminée", OnlineRegistrationStatus.WAITING_LIST_POSSIBLE: "Liste d'attente ouverte", OnlineRegistrationStatus.WAITING_LIST_FULL: "Liste d'attente complète", diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 93541d7..823b2a7 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -223,7 +223,7 @@ class Tournament(models.Model): return None registration_status = None - if self.online_register_is_enabled() is True: + if self.enable_online_registration == True: registration_status = self.get_online_registration_status().status_localized() if teams is not None and len(teams) > 0: word = "inscription" @@ -231,6 +231,8 @@ class Tournament(models.Model): word = word + "s" if registration_status is not None: return f"{registration_status}\n{len(teams)} {word}" + else: + return f"{len(teams)} {word}" else: if registration_status is not None: return f"{registration_status}" @@ -791,8 +793,11 @@ class Tournament(models.Model): return group_stages def display_rankings(self): - return True - + if self.supposedly_in_progress(): + return True + if self.end_date is not None: + return True + return False def display_tournament(self): if self.publish_tournament: @@ -942,12 +947,12 @@ class Tournament(models.Model): # Date d'ouverture if self.opening_registration_date: - date = formats.date_format(self.opening_registration_date, format='j F Y H:i') + date = formats.date_format(timezone.localtime(self.opening_registration_date), format='j F Y H:i') options.append(f"Ouverture des inscriptions le {date}") # Date limite if self.registration_date_limit: - date = formats.date_format(self.registration_date_limit, format='j F Y H:i') + date = formats.date_format(timezone.localtime(self.registration_date_limit), format='j F Y H:i') options.append(f"Clôture des inscriptions le {date}") # Cible d'équipes @@ -1055,7 +1060,7 @@ class Tournament(models.Model): # Check if registration is closed if self.registration_date_limit is not None: - if timezone.now() > self.registration_date_limit: + if timezone.now() > timezone.localtime(self.registration_date_limit): return False # Otherwise unregistration is allowed diff --git a/tournaments/templates/register_tournament.html b/tournaments/templates/register_tournament.html index 0528874..de84e2c 100644 --- a/tournaments/templates/register_tournament.html +++ b/tournaments/templates/register_tournament.html @@ -114,11 +114,11 @@
{% if tournament.get_waiting_list_position == 1 %} - Tournoi complet, {{ tournament.get_waiting_list_position }} équipe en liste d'attente devant vous + Tournoi complet, {{ tournament.get_waiting_list_position }} équipe en liste d'attente actuellement. {% elif tournament.get_waiting_list_position > 1 %} - Tournoi complet, {{ tournament.get_waiting_list_position }} équipes en liste d'attente devant vous + Tournoi complet, {{ tournament.get_waiting_list_position }} équipes en liste d'attente actuellement. {% elif tournament.get_waiting_list_position == 0 %} - Tournoi complet, vous êtes la première équipe en liste d'attente. + Tournoi complet, vous seriez la première équipe en liste d'attente. {% endif %}
diff --git a/tournaments/templates/tournaments/tournament_info.html b/tournaments/templates/tournaments/tournament_info.html index b67bd59..586f917 100644 --- a/tournaments/templates/tournaments/tournament_info.html +++ b/tournaments/templates/tournaments/tournament_info.html @@ -14,7 +14,7 @@
- {% if tournament.online_register_is_enabled and team %} + {% if tournament.enable_online_registration and team %}

Votre équipe

@@ -103,7 +103,7 @@

{% endif %} - {% if tournament.online_register_is_enabled %} + {% if tournament.enable_online_registration %}

Inscription en ligne