diff --git a/rest_auth/views.py b/rest_auth/views.py index 5eaae6b..5aa7a70 100644 --- a/rest_auth/views.py +++ b/rest_auth/views.py @@ -3,6 +3,7 @@ from django.contrib.auth import ( logout as django_logout ) from django.conf import settings +from django.contrib.auth import get_user_model from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext_lazy as _ @@ -130,6 +131,14 @@ class UserDetailsView(RetrieveUpdateAPIView): def get_object(self): return self.request.user + def get_queryset(self): + """ + Adding this method since it is sometimes called when using + django-rest-swagger + https://github.com/Tivix/django-rest-auth/issues/275 + """ + return get_user_model().objects.none() + class PasswordResetView(GenericAPIView):