fix issue with teams algo

clubs
Razmig Sarkissian 1 year ago
parent 363190ecec
commit 0e984fb1c3
  1. 4
      tournaments/models/tournament.py

@ -164,6 +164,7 @@ class Tournament(models.Model):
initial_weight = team_registration.initial_weight() initial_weight = team_registration.initial_weight()
date = team_registration.registration_date date = team_registration.registration_date
team = TeamList(names, weight, date, initial_weight, team_registration.logo) team = TeamList(names, weight, date, initial_weight, team_registration.logo)
team.set_stage("Attente")
teams.append(team) teams.append(team)
if team_registration.wild_card_bracket: if team_registration.wild_card_bracket:
wildcard_bracket.append(team) wildcard_bracket.append(team)
@ -172,6 +173,9 @@ class Tournament(models.Model):
else: else:
complete_teams.append(team) complete_teams.append(team)
if len(teams) < self.team_count:
return teams
seeds_count = min(self.team_count, len(teams)) - self.group_stage_count * self.teams_per_group_stage - len(wildcard_bracket) seeds_count = min(self.team_count, len(teams)) - self.group_stage_count * self.teams_per_group_stage - len(wildcard_bracket)
group_stage_members_count = self.group_stage_count * self.teams_per_group_stage - len(wildcard_group_stage) group_stage_members_count = self.group_stage_count * self.teams_per_group_stage - len(wildcard_group_stage)
if group_stage_members_count < 0: if group_stage_members_count < 0:

Loading…
Cancel
Save