From 46a31453a9a890d14bee7efcc139c81580228637 Mon Sep 17 00:00:00 2001 From: Raz Date: Fri, 20 Dec 2024 15:09:06 +0100 Subject: [PATCH] fix call date to registration date --- tournaments/models/tournament.py | 8 ++++---- tournaments/templates/tournaments/team_row.html | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 44202a8..3363552 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -341,7 +341,7 @@ class Tournament(models.Model): # print(f"Group stage members count: {group_stage_members_count}") if self.team_sorting == TeamSortingType.INSCRIPTION_DATE: - complete_teams.sort(key=lambda s: (s.date is None, s.date or datetime.min, s.initial_weight, s.team_registration.id)) + complete_teams.sort(key=lambda s: (s.registration_date is None, s.registration_date or datetime.min, s.initial_weight, s.team_registration.id)) else: complete_teams.sort(key=lambda s: (s.initial_weight, s.team_registration.id)) @@ -370,7 +370,7 @@ class Tournament(models.Model): if waiting_list_count > 0: waiting_teams = waiting_teams + complete_teams[-waiting_list_count:] if self.team_sorting == TeamSortingType.INSCRIPTION_DATE: - waiting_teams.sort(key=lambda s: (s.date is None, s.date or datetime.min, s.initial_weight, s.team_registration.id)) + waiting_teams.sort(key=lambda s: (s.registration_date is None, s.registration_date or datetime.min, s.initial_weight, s.team_registration.id)) else: waiting_teams.sort(key=lambda s: (s.initial_weight, s.team_registration.id)) else: @@ -914,7 +914,7 @@ class TeamSummon: class TeamItem: def __init__(self, team_registration): self.names = team_registration.team_names() - self.date = team_registration.local_call_date() + self.registration_date = team_registration.registration_date self.weight = team_registration.weight self.initial_weight = team_registration.initial_weight() self.image = team_registration.logo @@ -929,7 +929,7 @@ class TeamItem: def to_dict(self): return { "names": self.names, - "date": self.date, + "registration_date": self.registration_date, "weight": self.weight, "initial_weight": self.initial_weight, "image": self.image, diff --git a/tournaments/templates/tournaments/team_row.html b/tournaments/templates/tournaments/team_row.html index 09867b8..a9c71ef 100644 --- a/tournaments/templates/tournaments/team_row.html +++ b/tournaments/templates/tournaments/team_row.html @@ -12,6 +12,10 @@
{{ name }}
{% endfor %} + {% else %} +
+
Bloqué
+
{% endif %} {% if tournament.hide_teams_weight %}