Commit 27f853d6 by Clinton Blackburn

Followup to Credit Patch

- Removed unused variable
- Updated message class and text
- HTML-escaping relevant fields

ECOM-2893
parent 2f131faf
...@@ -116,9 +116,8 @@ class CreditCourseDashboardTest(ModuleStoreTestCase): ...@@ -116,9 +116,8 @@ class CreditCourseDashboardTest(ModuleStoreTestCase):
self._make_eligible() self._make_eligible()
self._purchase_credit() self._purchase_credit()
# Expect that the user's status is "pending"
response = self._load_dashboard() response = self._load_dashboard()
self.assertContains(response, "credit-request-pending-msg") self.assertContains(response, "credit-request-not-started-msg")
def test_purchased_credit_and_request_pending(self): def test_purchased_credit_and_request_pending(self):
# Simulate that the user has purchased credit and initiated a request, # Simulate that the user has purchased credit and initiated a request,
......
...@@ -13,9 +13,6 @@ ...@@ -13,9 +13,6 @@
error = credit_status['error'] error = credit_status['error']
status = 'eligible'
# Translators: provider_name is the name of a credit provider or university (e.g. State University) # Translators: provider_name is the name of a credit provider or university (e.g. State University)
credit_msg = _("You have completed this course and are eligible to purchase course credit. Select <strong>Get Credit</strong> to get started.") credit_msg = _("You have completed this course and are eligible to purchase course credit. Select <strong>Get Credit</strong> to get started.")
credit_msg_class = "credit-eligibility-msg" credit_msg_class = "credit-eligibility-msg"
...@@ -35,7 +32,7 @@ ...@@ -35,7 +32,7 @@
"at the {link_to_provider_site} website. Select <b>Request Credit</b> to get started.").format( "at the {link_to_provider_site} website. Select <b>Request Credit</b> to get started.").format(
link_to_provider_site=provider_link, link_to_provider_site=provider_link,
) )
credit_msg_class = "credit-request-pending-msg" credit_msg_class = "credit-request-not-started-msg"
credit_btn_label = _("Request Credit") credit_btn_label = _("Request Credit")
credit_btn_class = 'pending-credit-btn' credit_btn_class = 'pending-credit-btn'
elif request_status == 'pending': elif request_status == 'pending':
...@@ -77,7 +74,7 @@ ...@@ -77,7 +74,7 @@
</p> </p>
<div class="credit-action"> <div class="credit-action">
% if credit_btn_label: % if credit_btn_label:
<a class="btn credit-btn ${credit_btn_class}" href="${credit_btn_href}" target="_blank" data-course-key="${credit_status['course_key']}" data-user="${user.username}" data-provider="${credit_status['provider_id']}"> <a class="btn credit-btn ${credit_btn_class}" href="${credit_btn_href | h}" target="_blank" data-course-key="${credit_status['course_key'] | h}" data-user="${user.username | h}" data-provider="${credit_status['provider_id'] | h}">
${credit_btn_label} ${credit_btn_label}
</a> </a>
% endif % endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment