diff --git a/lms/djangoapps/student_account/views.py b/lms/djangoapps/student_account/views.py index 23efbed7b4..70c9c8c08e 100644 --- a/lms/djangoapps/student_account/views.py +++ b/lms/djangoapps/student_account/views.py @@ -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