fix bracket

redesign-tournament-list
Razmig Sarkissian 8 months ago
parent 3078e56a17
commit 3b94a6f8fa
  1. 8
      tournaments/models/match.py
  2. 1
      tournaments/views.py

@ -390,7 +390,7 @@ class Match(models.Model):
ended = self.end_date is not None ended = self.end_date is not None
live_format = "Format " + FederalMatchCategory(self.format).format_label_short live_format = "Format " + FederalMatchCategory(self.format).format_label_short
livematch = LiveMatch(title, date, time_indication, court, self.started(), ended, group_stage_name, live_format, self.start_date, self.court_index, self.disabled, self.index) livematch = LiveMatch(title, date, time_indication, court, self.started(), ended, group_stage_name, live_format, self.start_date, self.court_index, self.disabled)
for team in self.live_teams(): for team in self.live_teams():
livematch.add_team(team) livematch.add_team(team)
@ -447,7 +447,7 @@ class Team:
} }
class LiveMatch: class LiveMatch:
def __init__(self, title, date, time_indication, court, started, ended, group_stage_name, format, start_date, court_index, disabled, index): def __init__(self, title, date, time_indication, court, started, ended, group_stage_name, format, start_date, court_index, disabled):
self.title = title self.title = title
self.date = date self.date = date
self.teams = [] self.teams = []
@ -461,7 +461,6 @@ class LiveMatch:
self.disabled = disabled self.disabled = disabled
self.start_date = start_date self.start_date = start_date
self.court_index = court_index self.court_index = court_index
self.index = index
def add_team(self, team): def add_team(self, team):
self.teams.append(team) self.teams.append(team)
@ -482,8 +481,7 @@ class LiveMatch:
"format": self.format, "format": self.format,
"disabled": self.disabled, "disabled": self.disabled,
"start_date": self.start_date, "start_date": self.start_date,
"court_index": self.court_index, "court_index": self.court_index
"index": self.index
} }
def show_time_indication(self): def show_time_indication(self):

@ -996,7 +996,6 @@ def tournament_bracket(request, tournament_id):
if loser_final: if loser_final:
loser_matches = loser_final.match_set.all() loser_matches = loser_final.match_set.all()
if len(loser_matches) >= 1: if len(loser_matches) >= 1:
print("loser_matches", loser_matches[0])
first_half_matches.append(loser_matches[0]) first_half_matches.append(loser_matches[0])

Loading…
Cancel
Save