From 819b4214c9de08b0036a92e960ee4d8b113bfb2b Mon Sep 17 00:00:00 2001 From: otthorn Date: Tue, 22 Mar 2022 12:26:44 +0100 Subject: [PATCH] Add QRCode View, URL and test template --- apps/member/templates/member/qr_code.html | 11 +++++++++++ apps/member/urls.py | 1 + apps/member/views.py | 7 +++++++ 3 files changed, 19 insertions(+) create mode 100644 apps/member/templates/member/qr_code.html diff --git a/apps/member/templates/member/qr_code.html b/apps/member/templates/member/qr_code.html new file mode 100644 index 00000000..69b2a351 --- /dev/null +++ b/apps/member/templates/member/qr_code.html @@ -0,0 +1,11 @@ +{% extends "base.html" %} +{% comment %} +SPDX-License-Identifier: GPL-3.0-or-later +{% endcomment %} +{% load i18n %} + +{% block content %} + +Affichage du QR Code ici + +{% endblock %} diff --git a/apps/member/urls.py b/apps/member/urls.py index b1c537d5..ca759ccf 100644 --- a/apps/member/urls.py +++ b/apps/member/urls.py @@ -24,4 +24,5 @@ urlpatterns = [ path('user//update_pic/', views.ProfilePictureUpdateView.as_view(), name="user_update_pic"), path('user//aliases/', views.ProfileAliasView.as_view(), name="user_alias"), path('manage-auth-token/', views.ManageAuthTokens.as_view(), name='auth_token'), + path('user//qr_code/', views.QRCodeView.as_view(), name='qr_code'), ] diff --git a/apps/member/views.py b/apps/member/views.py index 6ce8d4c5..b4c77519 100644 --- a/apps/member/views.py +++ b/apps/member/views.py @@ -331,6 +331,13 @@ class ManageAuthTokens(LoginRequiredMixin, TemplateView): context['token'] = Token.objects.get_or_create(user=self.request.user)[0] return context +class QRCodeView(LoginRequiredMixin, TemplateView): + """ + Affiche le QR Code + """ + model = QRCode + template_name = "member/qr_code.html" + extra_context = {"title": _("QR Code")} # ******************************* # # CLUB #