Raz 12 months ago
commit 6e9d52f613
  1. 4
      tournaments/models/team_registration.py
  2. 14
      tournaments/models/tournament.py

@ -87,7 +87,7 @@ class TeamRegistration(models.Model):
return "--"
def is_valid_for_summon(self):
return len(self.playerregistration_set.all()) > 0
return len(self.playerregistration_set.all()) > 0 or self.name is not None
def initial_weight(self):
if self.locked_weight is None:
@ -100,5 +100,5 @@ class TeamRegistration(models.Model):
if self.call_date:
return self.call_date.astimezone(timezone)
else:
print("no date")
# print("no date")
return None

@ -805,12 +805,12 @@ class Tournament(models.Model):
if bracket_start_date < group_stage_start_date:
return timezone.now() >=first_match_start_date
if timezone.now() >= bracket_start_date:
return True
return False
def bracket_matches(self):
matches = []
for round in self.round_set.all():
@ -837,11 +837,11 @@ class Tournament(models.Model):
start = timezoned_datetime.replace(hour=0, minute=0)
print(f"timezoned_datetime: {timezoned_datetime}")
print(f"tournament end date: {end}")
print(f"current time: {now}")
print(f"tournament start: {start}")
print(f"start <= now <= end: {start <= now <= end}")
# print(f"timezoned_datetime: {timezoned_datetime}")
# print(f"tournament end date: {end}")
# print(f"current time: {now}")
# print(f"tournament start: {start}")
# print(f"start <= now <= end: {start <= now <= end}")
return start <= now <= end
@ -913,7 +913,7 @@ class TeamSummon:
class TeamItem:
def __init__(self, team_registration):
self.names = team_registration.team_names
self.names = team_registration.team_names()
self.date = team_registration.local_call_date()
self.weight = team_registration.weight
self.initial_weight = team_registration.initial_weight()

Loading…
Cancel
Save