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)