|
|
|
@ -337,13 +337,15 @@ class Tournament(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
def match_groups(self, broadcasted, group_stage_id, round_id): |
|
|
|
def match_groups(self, broadcasted, group_stage_id, round_id): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
display_brackets = self.display_matches() |
|
|
|
|
|
|
|
|
|
|
|
match_groups = [] |
|
|
|
match_groups = [] |
|
|
|
if group_stage_id: |
|
|
|
if group_stage_id: |
|
|
|
group_stage = self.groupstage_set.filter(id=group_stage_id).first() |
|
|
|
group_stage = self.groupstage_set.filter(id=group_stage_id).first() |
|
|
|
match_groups.append(self.group_stage_match_group(group_stage, broadcasted, hide_empty_matches=False)) |
|
|
|
match_groups.append(self.group_stage_match_group(group_stage, broadcasted, hide_empty_matches=False)) |
|
|
|
elif round_id: |
|
|
|
elif round_id: |
|
|
|
round = self.round_set.filter(id=round_id).first() |
|
|
|
round = self.round_set.filter(id=round_id).first() |
|
|
|
if round: |
|
|
|
if round and display_brackets is True: |
|
|
|
match_groups = self.round_match_groups(round, broadcasted, hide_empty_matches=False) |
|
|
|
match_groups = self.round_match_groups(round, broadcasted, hide_empty_matches=False) |
|
|
|
else: |
|
|
|
else: |
|
|
|
match_groups = self.all_groups(broadcasted) |
|
|
|
match_groups = self.all_groups(broadcasted) |
|
|
|
@ -352,6 +354,8 @@ class Tournament(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
def all_groups(self, broadcasted): |
|
|
|
def all_groups(self, broadcasted): |
|
|
|
groups = [] |
|
|
|
groups = [] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if self.display_matches(): |
|
|
|
for round in self.round_set.filter(parent=None).all().order_by('index'): |
|
|
|
for round in self.round_set.filter(parent=None).all().order_by('index'): |
|
|
|
groups.extend(self.round_match_groups(round, broadcasted, hide_empty_matches=True)) |
|
|
|
groups.extend(self.round_match_groups(round, broadcasted, hide_empty_matches=True)) |
|
|
|
|
|
|
|
|
|
|
|
@ -685,7 +689,7 @@ class Tournament(models.Model): |
|
|
|
|
|
|
|
|
|
|
|
def has_all_group_stages_started(self): |
|
|
|
def has_all_group_stages_started(self): |
|
|
|
for group_stage in self.groupstage_set.all(): |
|
|
|
for group_stage in self.groupstage_set.all(): |
|
|
|
if group_stage.has_at_least_one_started_match() == False: |
|
|
|
if group_stage.has_at_least_one_started_match() is False: |
|
|
|
return False |
|
|
|
return False |
|
|
|
return True |
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
|