add a confirm if place signal on team reg

timetoconfirm
Raz 7 months ago
parent 142f0929c2
commit dd98096ef9
  1. 12
      tournaments/models/tournament.py

@ -308,16 +308,22 @@ class Tournament(BaseModel):
def get_team_waiting_list_position(self, team_registration): def get_team_waiting_list_position(self, team_registration):
# Use the teams method to get sorted list of teams # Use the teams method to get sorted list of teams
now_utc = timezone.now()
current_time = now_utc.astimezone(self.timezone())
local_registration_federal_limit = self.local_registration_federal_limit()
if self.team_sorting == TeamSortingType.RANK and local_registration_federal_limit is not None:
if current_time < local_registration_federal_limit:
return -1
# Check if team_count exists
if self.team_count_limit == True:
all_teams = self.teams(True) all_teams = self.teams(True)
index = -1 index = -1
print(all_teams)
# Find position of team in all teams list # Find position of team in all teams list
for i, team in enumerate(all_teams): for i, team in enumerate(all_teams):
if team.team_registration.id == team_registration.id: if team.team_registration.id == team_registration.id:
index = i index = i
# Check if team_count exists
if self.team_count_limit == True:
# Team is not in list # Team is not in list
if index < 0: if index < 0:
print("Team is not in list", index, self.team_count) print("Team is not in list", index, self.team_count)

Loading…
Cancel
Save