diff --git a/tournaments/models/team_registration.py b/tournaments/models/team_registration.py index 709c61f..272163d 100644 --- a/tournaments/models/team_registration.py +++ b/tournaments/models/team_registration.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 diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 63f9d7f..44202a8 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -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()