From 8145e7dbdd002a0784a3844fb02bf745ac3f32a5 Mon Sep 17 00:00:00 2001 From: Raz Date: Thu, 3 Oct 2024 18:27:11 +0200 Subject: [PATCH] add club auto broadcast --- tournaments/views.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tournaments/views.py b/tournaments/views.py index a804738..59f71c0 100644 --- a/tournaments/views.py +++ b/tournaments/views.py @@ -224,6 +224,10 @@ def qr_code_url(request, tournament_id): qr_code_url = reverse('tournament', args=[tournament_id]) return request.build_absolute_uri(qr_code_url) +def qr_code_url_with_query(request, club_id): + url_with_query = f"{request.build_absolute_uri('/')}?club={str(club_id)}" + return url_with_query + def qr_code_options(): return QRCodeOptions(size=10, border=4, error_correction='L') @@ -346,7 +350,10 @@ def club_broadcast_auto(request, broadcast_code): #print(tournament_ids) return render(request, 'tournaments/broadcast/broadcasted_auto_event.html', { 'tournament_ids': tournament_ids, - 'club_name': club.name + 'club_name': club.name, + 'qr_code_url': qr_code_url_with_query(request, club.id), + 'qr_code_options': qr_code_options(), + }) def download(request):