From 0682896582b5e52d7620d94a352e2d7ed5eb4409 Mon Sep 17 00:00:00 2001 From: through-your-tears Date: Sun, 7 Apr 2024 09:37:56 +0300 Subject: [PATCH] =?UTF-8?q?=D0=91=D0=B0=D0=B3=20=D1=84=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jwtauth/admin.py | 5 +++-- src/jwtauth/views.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/jwtauth/admin.py b/src/jwtauth/admin.py index 342523a..0441cbf 100644 --- a/src/jwtauth/admin.py +++ b/src/jwtauth/admin.py @@ -3,7 +3,7 @@ from django.contrib.auth.models import Group from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from .forms import UserCreationForm, UserChangeForm -from .models import CustomUser, Profile, RefreshToken +from .models import CustomUser, Profile, RefreshToken, QRCode class UserAdmin(BaseUserAdmin): @@ -39,4 +39,5 @@ admin.site.register(CustomUser, UserAdmin) admin.site.unregister(Group) admin.site.register(RefreshToken) -admin.site.register(Profile) \ No newline at end of file +admin.site.register(Profile) +admin.site.register(QRCode) \ No newline at end of file diff --git a/src/jwtauth/views.py b/src/jwtauth/views.py index 575784c..7209bc8 100644 --- a/src/jwtauth/views.py +++ b/src/jwtauth/views.py @@ -221,7 +221,8 @@ class ProfileListAPIView(ListAPIView): class QRCodeRetrieveAPIView(RetrieveAPIView): serializer_class = QRCodeSerializer - queryset = QRCodeRepository.all() + # queryset = QRCodeRepository.all() + permission_classes = [IsAuthenticated] def get_object(self): return QRCodeRepository.get(self.request.user)