fix gs broadcast stuff

shop
Raz 8 months ago
parent 194a7c8ba3
commit 8cb08cd33b
  1. 3
      tournaments/models/group_stage.py
  2. 6
      tournaments/models/tournament.py
  3. 4
      tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html

@ -174,7 +174,8 @@ class LiveGroupStage:
return { return {
"title": self.title, "title": self.title,
"teams": [team.to_dict() for team in self.teams], "teams": [team.to_dict() for team in self.teams],
"duration": self.formatted_duration() "duration": self.formatted_duration(),
"started": self.started()
} }
def started(self): def started(self):

@ -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 # 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. # 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()] team_summons_dicts = [summon.to_dict() for summon in self.team_summons()]
if group_stages: if group_stages:
return { return {

@ -33,13 +33,13 @@
</div> </div>
<div class="flex-right"> <div class="flex-right">
<div x-show="group_stage.started === true"> <div x-show="group_stage.started === false">
<div class="score ws numbers" x-show="hide_weight === false"> <div class="score ws numbers" x-show="hide_weight === false">
<span x-text="group_stage.teams[i-1].weight"></span> <span x-text="group_stage.teams[i-1].weight"></span>
</div> </div>
</div> </div>
<div x-show="group_stage.teams[i-1].match_count > 0 and group_stage.started === false"> <div x-show="group_stage.teams[i-1].match_count > 0 && group_stage.started === true">
<div class="score ws numbers"><span x-text="group_stage.teams[i-1].win_loss"></span></div> <div class="score ws numbers"><span x-text="group_stage.teams[i-1].win_loss"></span></div>
<div class="ws numbers"><span x-text="group_stage.teams[i-1].diff"></span></div> <div class="ws numbers"><span x-text="group_stage.teams[i-1].diff"></span></div>
</div> </div>

Loading…
Cancel
Save