This commit is contained in:
Jose Antonio Gonzalez
2017-11-24 14:59:41 +02:00
parent 0171e79764
commit 5150a96005

View File

@@ -212,15 +212,13 @@ def password_change_request_handler(request):
email =\
user.email if user.is_authenticated() else request.POST.get('email')
error_message =\
_("Some error occured during password change. Please try again")
if email:
status_response = change_password(request, email)
if status_response == 500:
return\
HttpResponse(
_("Some error occured during password change. Please try "
"again"),
status=status_response
)
return HttpResponse(error_message, status=status_response)
elif status_response == 403:
return HttpResponseForbidden()
@@ -615,8 +613,6 @@ class RecoverPasswordView(views.APIView):
HttpResponse: 405 if using an unsupported HTTP method
"""
http_method_names = ["post"]
def post(self, request, format=None):
"""
Makes the request to change the password