|
|
|
@ -357,9 +357,9 @@ def broadcast_json(request, tournament_id): |
|
|
|
def tournament_matches_json(request, tournament_id): |
|
|
|
def tournament_matches_json(request, tournament_id): |
|
|
|
tournament = get_object_or_404(Tournament, pk=tournament_id) |
|
|
|
tournament = get_object_or_404(Tournament, pk=tournament_id) |
|
|
|
matches, group_stages = tournament.broadcasted_matches_and_group_stages() |
|
|
|
matches, group_stages = tournament.broadcasted_matches_and_group_stages() |
|
|
|
live_matches = [match.live_match() for match in matches] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data = json.dumps(live_matches, default=vars) |
|
|
|
live_matches_dicts = [match.live_match().to_dict() for match in matches] |
|
|
|
|
|
|
|
data = json.dumps(live_matches_dicts, default=vars) |
|
|
|
return HttpResponse(data, content_type='application/json') |
|
|
|
return HttpResponse(data, content_type='application/json') |
|
|
|
|
|
|
|
|
|
|
|
def tournament_prog_json(request, tournament_id): |
|
|
|
def tournament_prog_json(request, tournament_id): |
|
|
|
@ -372,7 +372,7 @@ def tournament_prog_json(request, tournament_id): |
|
|
|
if match is None or isinstance(match, dict) and match.get('empty'): |
|
|
|
if match is None or isinstance(match, dict) and match.get('empty'): |
|
|
|
live_matches.append({"empty": True}) |
|
|
|
live_matches.append({"empty": True}) |
|
|
|
else: |
|
|
|
else: |
|
|
|
live_matches.append(match.live_match()) |
|
|
|
live_matches.append(match.live_match().to_dict()) |
|
|
|
|
|
|
|
|
|
|
|
data = json.dumps(live_matches, default=vars) |
|
|
|
data = json.dumps(live_matches, default=vars) |
|
|
|
return HttpResponse(data, content_type='application/json') |
|
|
|
return HttpResponse(data, content_type='application/json') |
|
|
|
|