clubs
Laurent 2 years ago
parent ccd1e2fc74
commit 4cf08b6509
  1. 14
      tournaments/models/group_stage.py
  2. 2
      tournaments/models/team_registration.py
  3. 4
      tournaments/templates/tournaments/broadcasted_group_stages.html

@ -28,6 +28,16 @@ class GroupStage(models.Model):
def live_group_stages(self):
lgs = LiveGroupStage(self.name())
gs_teams = {}
# init all teams
for team_registration in self.teamregistration_set.all():
if team_registration in gs_teams:
team = gs_teams[team_registration]
else:
team = GroupStageTeam(team_registration)
gs_teams[team_registration] = team
# compute matches
for match in self.match_set.all():
lgs.add_match(match)
team_scores = match.team_scores.all()
@ -37,10 +47,6 @@ class GroupStage(models.Model):
team_registration = team_score.team_registration
if team_registration in gs_teams:
team = gs_teams[team_registration]
else:
team = GroupStageTeam(team_registration)
gs_teams[team_registration] = team
if match.winning_team_id == team_registration.id:
team.wins += 1
else:

@ -40,7 +40,7 @@ class TeamRegistration(models.Model):
matches = [m for m in all_matches if m.end_date is None]
if matches:
return matches[0]
else:
elif all_matches:
return all_matches[0]
def next_stage(self):

@ -71,7 +71,7 @@
<div class="dark_bubble">
<div class="flex-row">
<label class="left-label matchtitle white"><span x-text="group_stage.title"></span></label>
<label class="left-label matchtitle winner"><span x-text="group_stage.title"></span></label>
<!-- <label class="right-label info"><span x-text="group_stage.date"></span></label> -->
</div>
@ -103,7 +103,7 @@
</div>
</div>
<div x-show="i === 1">
<div x-show="i != group_stage.teams.length">
<div class="bottom-border"></div>
</div>

Loading…
Cancel
Save