diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index 44b9bc64e2..358f1d1a32 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -738,10 +738,7 @@ class TestCoachDashboard(CcxTestCase, LoginEnrollmentTestCase): # some error messages are returned for one of the views only if view_name == 'ccx_manage_student' and not is_email(identifier): - error_message = 'Could not find a user with name or email "{identifier}" '.format( - identifier=identifier - ) - self.assertContains(response, error_message, status_code=200) + self.assertContains(response, 'Could not find a user with name or email ', status_code=200) if is_email(identifier): if send_email: diff --git a/lms/templates/ccx/coach_dashboard.html b/lms/templates/ccx/coach_dashboard.html index 67307b4a1f..b94ca71a35 100644 --- a/lms/templates/ccx/coach_dashboard.html +++ b/lms/templates/ccx/coach_dashboard.html @@ -1,8 +1,12 @@ +<%page expression_filter="h"/> <%inherit file="/main.html" /> <%namespace name='static' file='/static_content.html'/> <%! from django.utils.translation import ugettext as _ from django.core.urlresolvers import reverse +from openedx.core.djangolib.js_utils import ( + dump_js_escaped_json, js_escaped_string +) %> <%block name="pagetitle">${_("CCX Coach Dashboard")}%block> @@ -163,14 +167,14 @@ from django.core.urlresolvers import reverse function validateForm(form) { var newCCXName = $(form).find('#ccx_name').val(); var $errorMessage = $('#ccx-create-message'); - var hasCcxConnector = ${has_ccx_connector}; + var hasCcxConnector = ${has_ccx_connector | n, dump_js_escaped_json}; if (!newCCXName && !hasCcxConnector) { - $errorMessage.text("${_('Please enter a valid CCX name.')}"); + $errorMessage.text("${_('Please enter a valid CCX name.') | n, js_escaped_string}"); $errorMessage.show(); return false; } else if (hasCcxConnector) { - $errorMessage.html('${use_ccx_con_error_message}'); + $errorMessage.html('${use_ccx_con_error_message | n, js_escaped_string}'); $errorMessage.show(); return false; } diff --git a/lms/templates/ccx/enrollment.html b/lms/templates/ccx/enrollment.html index a6c64c4130..8d0ba6a994 100644 --- a/lms/templates/ccx/enrollment.html +++ b/lms/templates/ccx/enrollment.html @@ -1,4 +1,8 @@ -<%! from django.utils.translation import ugettext as _ %> +<%page expression_filter="h"/> +<%! +from django.utils.translation import ugettext as _ +from openedx.core.djangolib.markup import Text, HTML +%>