|
|
|
@ -400,11 +400,10 @@ class Tournament(models.Model): |
|
|
|
matches = [] |
|
|
|
matches = [] |
|
|
|
group_stages = [] |
|
|
|
group_stages = [] |
|
|
|
|
|
|
|
|
|
|
|
if self.group_stages_running(): |
|
|
|
if len(self.groupstage_set.all()) > 0 and self.no_bracket_match_has_started(): |
|
|
|
group_stages = self.live_group_stages() |
|
|
|
group_stages = self.live_group_stages() |
|
|
|
matches = self.broadcasted_group_stages_matches() |
|
|
|
matches = self.broadcasted_group_stages_matches() |
|
|
|
else: |
|
|
|
else: |
|
|
|
# last_started_match = self.first_unfinished_match() |
|
|
|
|
|
|
|
current_round = self.round_to_show() |
|
|
|
current_round = self.round_to_show() |
|
|
|
if current_round: |
|
|
|
if current_round: |
|
|
|
previous_round = self.round_for_index(current_round.index + 1) |
|
|
|
previous_round = self.round_for_index(current_round.index + 1) |
|
|
|
@ -418,6 +417,14 @@ class Tournament(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
return matches, group_stages |
|
|
|
return matches, group_stages |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def no_bracket_match_has_started(self): |
|
|
|
|
|
|
|
matches = [] |
|
|
|
|
|
|
|
for round in self.round_set.all(): |
|
|
|
|
|
|
|
for match in round.match_set.all(): |
|
|
|
|
|
|
|
if match.started(): |
|
|
|
|
|
|
|
return False |
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
def all_matches(self, hide_empty_matches): |
|
|
|
def all_matches(self, hide_empty_matches): |
|
|
|
matches = [] |
|
|
|
matches = [] |
|
|
|
for round in self.round_set.all(): |
|
|
|
for round in self.round_set.all(): |
|
|
|
@ -437,6 +444,7 @@ class Tournament(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
def group_stages_running(self): |
|
|
|
def group_stages_running(self): |
|
|
|
if len(self.groupstage_set.all()) > 0: |
|
|
|
if len(self.groupstage_set.all()) > 0: |
|
|
|
|
|
|
|
# check le debut des match de Round |
|
|
|
matches = self.group_stage_matches() |
|
|
|
matches = self.group_stage_matches() |
|
|
|
running_group_stage_matches = [m for m in matches if m.end_date is None] |
|
|
|
running_group_stage_matches = [m for m in matches if m.end_date is None] |
|
|
|
return len(running_group_stage_matches) > 0 |
|
|
|
return len(running_group_stage_matches) > 0 |
|
|
|
|