Баг фикс

main
through-your-tears 9 months ago
parent f8e33cf400
commit 0682896582

@ -3,7 +3,7 @@ from django.contrib.auth.models import Group
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .forms import UserCreationForm, UserChangeForm from .forms import UserCreationForm, UserChangeForm
from .models import CustomUser, Profile, RefreshToken from .models import CustomUser, Profile, RefreshToken, QRCode
class UserAdmin(BaseUserAdmin): class UserAdmin(BaseUserAdmin):
@ -40,3 +40,4 @@ admin.site.unregister(Group)
admin.site.register(RefreshToken) admin.site.register(RefreshToken)
admin.site.register(Profile) admin.site.register(Profile)
admin.site.register(QRCode)

@ -221,7 +221,8 @@ class ProfileListAPIView(ListAPIView):
class QRCodeRetrieveAPIView(RetrieveAPIView): class QRCodeRetrieveAPIView(RetrieveAPIView):
serializer_class = QRCodeSerializer serializer_class = QRCodeSerializer
queryset = QRCodeRepository.all() # queryset = QRCodeRepository.all()
permission_classes = [IsAuthenticated]
def get_object(self): def get_object(self):
return QRCodeRepository.get(self.request.user) return QRCodeRepository.get(self.request.user)

Loading…
Cancel
Save