diff --git a/lms/djangoapps/courseware/tests/test_password_history.py b/lms/djangoapps/courseware/tests/test_password_history.py index 89b7f6640d..5bf49b2c4b 100644 --- a/lms/djangoapps/courseware/tests/test_password_history.py +++ b/lms/djangoapps/courseware/tests/test_password_history.py @@ -169,7 +169,7 @@ class TestPasswordHistory(LoginEnrollmentTestCase): student_email, _ = self._setup_user() user = User.objects.get(email=student_email) - err_msg = 'You are re-using a password that you have used recently. You must have 1 distinct password' + err_msg = 'You are re\\\\u002Dusing a password that you have used recently. You must have 1 distinct password' success_msg = 'Your Password Reset is Complete' token = default_token_generator.make_token(user) @@ -199,7 +199,7 @@ class TestPasswordHistory(LoginEnrollmentTestCase): staff_email, _ = self._setup_user(is_staff=True) user = User.objects.get(email=staff_email) - err_msg = 'You are re-using a password that you have used recently. You must have 2 distinct passwords' + err_msg = 'You are re\\\\u002Dusing a password that you have used recently. You must have 2 distinct passwords' success_msg = 'Your Password Reset is Complete' token = default_token_generator.make_token(user) diff --git a/lms/templates/registration/password_reset_confirm.html b/lms/templates/registration/password_reset_confirm.html index bb6ea1e868..b97b95dae9 100644 --- a/lms/templates/registration/password_reset_confirm.html +++ b/lms/templates/registration/password_reset_confirm.html @@ -4,6 +4,7 @@ <%! from django.utils.translation import ugettext as _ +from openedx.core.djangolib.js_utils import js_escaped_string from openedx.core.djangolib.markup import HTML, Text %> @@ -28,7 +29,7 @@ from openedx.core.djangolib.markup import HTML, Text id="password-reset-confirm-react", props={ 'csrfToken': csrf_token, - 'errorMessage': err_msg if err_msg else '', + 'errorMessage': js_escaped_string(err_msg) if err_msg else '', }, )} % else: