fix tz stuff and ttc stuff

timetoconfirm
Raz 7 months ago
parent 7efafb738e
commit 03e2b874e8
  1. 8
      tournaments/models/tournament.py
  2. 6
      tournaments/signals.py
  3. 2
      tournaments/tasks.py

@ -1121,7 +1121,6 @@ class Tournament(BaseModel):
return False
# Get the current registration status
status = self.get_online_registration_status()
print(status, self.has_started())
# Define which status values should allow automatic waiting list
status_map = {
OnlineRegistrationStatus.OPEN: True,
@ -1528,7 +1527,7 @@ class Tournament(BaseModel):
datetime: The confirmation deadline datetime
"""
# Skip if feature not enabled
if self.enable_time_to_confirm is False:
if self.automatic_waiting_list() is False:
return None
config = settings.TOURNAMENT_SETTINGS['TIME_TO_CONFIRM']
@ -1635,6 +1634,11 @@ class Tournament(BaseModel):
)
print(f"Before hours: {before_hours}, After hours: {after_hours}")
tournament_start_date_minus_five = tournament_start_date - timedelta(minutes=5)
if raw_deadline >= tournament_start_date_minus_five:
print(f"Raw Deadline is after tournament_start_date_minus_five: {raw_deadline}, {tournament_start_date_minus_five}")
raw_deadline = tournament_start_date_minus_five
print(f"Live testing: {live_testing}")
print(f"Current time: {current_time}")
print(f"Minutes to confirm: {minutes_to_confirm}")

@ -58,9 +58,9 @@ def notify_team(team, tournament, message_type):
if tournament.has_ended():
print("returning because tournament.has_ended")
return
# if tournament.will_start_soon():
# print("returning because tournament.supposedly_in_progress")
# return
if tournament.has_started():
print("returning because tournament.has_started")
return
if is_not_sqlite_backend():
print("is_not_sqlite_backend")

@ -43,7 +43,7 @@ def check_confirmation_deadlines():
processed_teams.add(team_registration.id)
tournament = team_registration.tournament
if not tournament or not tournament.automatic_waiting_list():
if not tournament:
continue
teams = tournament.teams(True)

Loading…
Cancel
Save