diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 89dea15..b2c60dd 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -361,7 +361,7 @@ class Tournament(models.Model): live_matches = [match.live_match() for match in matches] return MatchGroup(name, live_matches) - def broadcasted_group_stages(self): + def live_group_stages(self): group_stages = list(self.groupstage_set.all()) group_stages.sort(key=lambda gs: gs.index) return [gs.live_group_stages() for gs in group_stages] @@ -401,7 +401,7 @@ class Tournament(models.Model): group_stages = [] if self.group_stages_running(): - group_stages = self.broadcasted_group_stages() + group_stages = self.live_group_stages() matches = self.broadcasted_group_stages_matches() else: # last_started_match = self.first_unfinished_match() @@ -414,7 +414,7 @@ class Tournament(models.Model): matches.extend(previous_round.get_matches_recursive(True)) else: matches.extend(current_round.all_matches(True)) - group_stages = self.broadcasted_group_stages() + group_stages = self.live_group_stages() return matches, group_stages diff --git a/tournaments/views.py b/tournaments/views.py index 0219e17..a4a1c6d 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -224,7 +224,7 @@ def tournament_broadcasted_group_stages(request, tournament_id): def tournament_live_group_stage_json(request, tournament_id): tournament = get_object_or_404(Tournament, pk=tournament_id) - gs_dicts = [gs.to_dict() for gs in tournament.broadcasted_group_stages()] + gs_dicts = [gs.to_dict() for gs in tournament.live_group_stages()] # group_stages = tournament.live_group_stages() data = json.dumps(gs_dicts) return HttpResponse(data, content_type='application/json')