mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 00:56:34 +03:00
Fix UserWarning in SocialAccountListView and SocialAccountDisconnectView
Django was raising "is not compatible with schema generation" user warning at startup
This commit is contained in:
parent
a3057b7aa1
commit
47b43a5235
|
@ -154,7 +154,10 @@ class SocialAccountListView(ListAPIView):
|
|||
permission_classes = (IsAuthenticated,)
|
||||
|
||||
def get_queryset(self):
|
||||
return SocialAccount.objects.filter(user=self.request.user)
|
||||
if self.request:
|
||||
return SocialAccount.objects.filter(user=self.request.user)
|
||||
else:
|
||||
return SocialAccount.objects.none()
|
||||
|
||||
|
||||
class SocialAccountDisconnectView(GenericAPIView):
|
||||
|
@ -166,7 +169,10 @@ class SocialAccountDisconnectView(GenericAPIView):
|
|||
permission_classes = (IsAuthenticated,)
|
||||
|
||||
def get_queryset(self):
|
||||
return SocialAccount.objects.filter(user=self.request.user)
|
||||
if self.request:
|
||||
return SocialAccount.objects.filter(user=self.request.user)
|
||||
else:
|
||||
return SocialAccount.objects.none()
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
accounts = self.get_queryset()
|
||||
|
|
Loading…
Reference in New Issue
Block a user