|
|
|
|
@ -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: |
|
|
|
|
@ -938,7 +938,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 |
|
|
|
|
@ -953,7 +953,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, |
|
|
|
|
|