mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-12-02 05:43:44 +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
|
||||
}
|
||||
serializer = serializer_class(instance=data,
|
||||
context={'request': self.request})
|
||||
context=self.get_serializer_context())
|
||||
else:
|
||||
serializer = serializer_class(instance=self.token,
|
||||
context={'request': self.request})
|
||||
context=self.get_serializer_context())
|
||||
|
||||
response = Response(serializer.data, status=status.HTTP_200_OK)
|
||||
if getattr(settings, 'REST_USE_JWT', False):
|
||||
|
@ -106,7 +106,7 @@ class LoginView(GenericAPIView):
|
|||
def post(self, request, *args, **kwargs):
|
||||
self.request = request
|
||||
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.login()
|
||||
|
|
Loading…
Reference in New Issue
Block a user