From 8cb08cd33b18cad0a6eef327ac61c9ff932856cb Mon Sep 17 00:00:00 2001 From: Raz Date: Mon, 10 Mar 2025 11:52:21 +0100 Subject: [PATCH] fix gs broadcast stuff --- tournaments/models/group_stage.py | 3 ++- tournaments/models/tournament.py | 6 +++++- .../tournaments/broadcast/broadcasted_group_stage.html | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/tournaments/models/group_stage.py b/tournaments/models/group_stage.py index 11a4b81..c1fa9a8 100644 --- a/tournaments/models/group_stage.py +++ b/tournaments/models/group_stage.py @@ -174,7 +174,8 @@ class LiveGroupStage: return { "title": self.title, "teams": [team.to_dict() for team in self.teams], - "duration": self.formatted_duration() + "duration": self.formatted_duration(), + "started": self.started() } def started(self): diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 25e4805..1b8ef83 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -602,7 +602,11 @@ class Tournament(models.Model): # if now is before the first match, we want to show the summons + group stage or first matches # change timezone to datetime to avoid the bug RuntimeWarning: DateTimeField Tournament.start_date received a naive datetime (2024-05-16 00:00:00) while time zone support is active. - if timezone.now() < self.start_date: + current_time = timezone.now() + tournament_start = self.local_start_date() + one_hour_before_start = tournament_start - timedelta(hours=1) + + if current_time < one_hour_before_start: team_summons_dicts = [summon.to_dict() for summon in self.team_summons()] if group_stages: return { diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html b/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html index 0d35253..6371829 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html @@ -33,13 +33,13 @@
-
+
-
+