From f401830f7a65bd898dd14a2b06f01d2046ddf9b8 Mon Sep 17 00:00:00 2001 From: Zainab Amir Date: Mon, 30 Nov 2020 12:41:56 +0500 Subject: [PATCH] Add error_code to AuthFailedError (#25691) --- openedx/core/djangoapps/user_authn/views/login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/core/djangoapps/user_authn/views/login.py b/openedx/core/djangoapps/user_authn/views/login.py index d8792f056e..b0a8fd7550 100644 --- a/openedx/core/djangoapps/user_authn/views/login.py +++ b/openedx/core/djangoapps/user_authn/views/login.py @@ -153,7 +153,7 @@ def _enforce_password_policy_compliance(request, user): except password_policy_compliance.NonCompliantPasswordException as e: send_password_reset_email_for_user(user, request) # Prevent the login attempt. - raise AuthFailedError(HTML(six.text_type(e))) + raise AuthFailedError(HTML(six.text_type(e)), error_code=e.__class__.__name__) def _log_and_raise_inactive_user_auth_error(unauthenticated_user):