mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-02 13:53:43 +03:00
Add compatibility for DRF 3.12
This commit is contained in:
parent
de08967210
commit
ca355baf7a
|
@ -78,10 +78,10 @@ class LoginView(GenericAPIView):
|
||||||
'refresh_token': self.refresh_token
|
'refresh_token': self.refresh_token
|
||||||
}
|
}
|
||||||
serializer = serializer_class(instance=data,
|
serializer = serializer_class(instance=data,
|
||||||
context={'request': self.request})
|
context=self.get_serializer_context())
|
||||||
else:
|
else:
|
||||||
serializer = serializer_class(instance=self.token,
|
serializer = serializer_class(instance=self.token,
|
||||||
context={'request': self.request})
|
context=self.get_serializer_context())
|
||||||
|
|
||||||
response = Response(serializer.data, status=status.HTTP_200_OK)
|
response = Response(serializer.data, status=status.HTTP_200_OK)
|
||||||
if getattr(settings, 'REST_USE_JWT', False):
|
if getattr(settings, 'REST_USE_JWT', False):
|
||||||
|
@ -106,7 +106,7 @@ class LoginView(GenericAPIView):
|
||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
self.request = request
|
self.request = request
|
||||||
self.serializer = self.get_serializer(data=self.request.data,
|
self.serializer = self.get_serializer(data=self.request.data,
|
||||||
context={'request': request})
|
context=self.get_serializer_context())
|
||||||
self.serializer.is_valid(raise_exception=True)
|
self.serializer.is_valid(raise_exception=True)
|
||||||
|
|
||||||
self.login()
|
self.login()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user