mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2024-11-22 17:16:34 +03:00
bugfix, request.DATA is deprecated, replaced with request.data
This commit is contained in:
parent
ad94008503
commit
02bf6fbe5b
|
@ -51,7 +51,7 @@ class RegisterView(APIView, SignupView):
|
|||
|
||||
def post(self, request, *args, **kwargs):
|
||||
self.initial = {}
|
||||
self.request.POST = self.request.DATA.copy()
|
||||
self.request.POST = self.request.data.copy()
|
||||
form_class = self.get_form_class()
|
||||
self.form = self.get_form(form_class)
|
||||
if self.form.is_valid():
|
||||
|
@ -78,7 +78,7 @@ class VerifyEmailView(APIView, ConfirmEmailView):
|
|||
return Response({}, status=status.HTTP_405_METHOD_NOT_ALLOWED)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
self.kwargs['key'] = self.request.DATA.get('key', '')
|
||||
self.kwargs['key'] = self.request.data.get('key', '')
|
||||
confirmation = self.get_object()
|
||||
confirmation.confirm(self.request)
|
||||
return Response({'message': 'ok'}, status=status.HTTP_200_OK)
|
||||
|
|
|
@ -50,7 +50,7 @@ class LoginView(GenericAPIView):
|
|||
)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
self.serializer = self.get_serializer(data=self.request.DATA)
|
||||
self.serializer = self.get_serializer(data=self.request.data)
|
||||
if not self.serializer.is_valid():
|
||||
return self.get_error_response()
|
||||
self.login()
|
||||
|
@ -110,8 +110,8 @@ class PasswordResetView(GenericAPIView):
|
|||
permission_classes = (AllowAny,)
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
# Create a serializer with request.DATA
|
||||
serializer = self.get_serializer(data=request.DATA)
|
||||
# Create a serializer with request.data
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
|
||||
if not serializer.is_valid():
|
||||
return Response(serializer.errors,
|
||||
|
@ -138,7 +138,7 @@ class PasswordResetConfirmView(GenericAPIView):
|
|||
permission_classes = (AllowAny,)
|
||||
|
||||
def post(self, request):
|
||||
serializer = self.get_serializer(data=request.DATA)
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
if not serializer.is_valid():
|
||||
return Response(
|
||||
serializer.errors, status=status.HTTP_400_BAD_REQUEST
|
||||
|
@ -160,7 +160,7 @@ class PasswordChangeView(GenericAPIView):
|
|||
permission_classes = (IsAuthenticated,)
|
||||
|
||||
def post(self, request):
|
||||
serializer = self.get_serializer(data=request.DATA)
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
if not serializer.is_valid():
|
||||
return Response(
|
||||
serializer.errors, status=status.HTTP_400_BAD_REQUEST
|
||||
|
|
Loading…
Reference in New Issue
Block a user