Skip to content

Commit 9df9608

Browse files
committed
Add get_queryset method to UserDetailsView due to issue with Swagger
#275
1 parent e81ed71 commit 9df9608

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

rest_auth/views.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
logout as django_logout
44
)
55
from django.conf import settings
6+
from django.contrib.auth import get_user_model
67
from django.core.exceptions import ObjectDoesNotExist
78
from django.utils.translation import ugettext_lazy as _
89

@@ -130,6 +131,14 @@ class UserDetailsView(RetrieveUpdateAPIView):
130131
def get_object(self):
131132
return self.request.user
132133

134+
def get_queryset(self):
135+
"""
136+
Adding this method since it is sometimes called when using
137+
django-rest-swagger
138+
https://github.com/Tivix/django-rest-auth/issues/275
139+
"""
140+
return get_user_model().objects.none()
141+
133142

134143
class PasswordResetView(GenericAPIView):
135144

0 commit comments

Comments
 (0)