This commit is contained in:
Alexander Lyon 2018-09-08 15:08:05 +00:00 committed by GitHub
commit 9f759cb3af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,7 @@ from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.generics import GenericAPIView, RetrieveUpdateAPIView
from rest_framework.permissions import IsAuthenticated, AllowAny
from rest_framework.authentication import TokenAuthentication, SessionAuthentication, BasicAuthentication
from .app_settings import (
TokenSerializer, UserDetailsSerializer, LoginSerializer,
@ -141,6 +142,7 @@ class UserDetailsView(RetrieveUpdateAPIView):
"""
serializer_class = UserDetailsSerializer
permission_classes = (IsAuthenticated,)
authentication_classes = (BasicAuthentication, SessionAuthentication, TokenAuthentication)
def get_object(self):
return self.request.user