From 891b952c99a6f7e8d170dd42ada535c64a8258ae Mon Sep 17 00:00:00 2001 From: stephensanchez Date: Tue, 20 Jan 2015 21:01:38 +0000 Subject: [PATCH 1/2] Making verification msg strings unicode friendly. --- lms/djangoapps/verify_student/tests/test_views.py | 4 ++++ lms/templates/verify_student/photo_reverification.html | 4 ++-- lms/templates/verify_student/photo_verification.html | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lms/djangoapps/verify_student/tests/test_views.py b/lms/djangoapps/verify_student/tests/test_views.py index 3561cf429b..69597a756d 100644 --- a/lms/djangoapps/verify_student/tests/test_views.py +++ b/lms/djangoapps/verify_student/tests/test_views.py @@ -309,6 +309,8 @@ class TestVerifiedView(ModuleStoreTestCase): """ def setUp(self): self.user = UserFactory.create(username="abc", password="test") + self.user.profile.name = u"Røøsty Bøøgins" + self.user.save() self.client.login(username="abc", password="test") self.course = CourseFactory.create(org='MITx', number='999.1x', display_name='Verified Course') self.course_id = self.course.id @@ -357,6 +359,8 @@ class TestReverifyView(ModuleStoreTestCase): """ def setUp(self): self.user = UserFactory.create(username="rusty", password="test") + self.user.profile.name = u"Røøsty Bøøgins" + self.user.profile.save() self.client.login(username="rusty", password="test") self.course = CourseFactory.create(org='MITx', number='999', display_name='Robot Super Course') self.course_key = self.course.id diff --git a/lms/templates/verify_student/photo_reverification.html b/lms/templates/verify_student/photo_reverification.html index 21f51adfd1..28d7ca3555 100644 --- a/lms/templates/verify_student/photo_reverification.html +++ b/lms/templates/verify_student/photo_reverification.html @@ -347,8 +347,8 @@

${_("Check Your Name")}

-

${_("Make sure your full name on your {platform_name} account ({full_name}) matches your ID. We will also use this as the name on your certificate.").format( - full_name="{name}".format(name=user_full_name), +

${_(u"Make sure your full name on your {platform_name} account ({full_name}) matches your ID. We will also use this as the name on your certificate.").format( + full_name=u"{name}".format(name=user_full_name), platform_name=settings.PLATFORM_NAME, )}

diff --git a/lms/templates/verify_student/photo_verification.html b/lms/templates/verify_student/photo_verification.html index 8bc2b57098..9842d4a5b5 100644 --- a/lms/templates/verify_student/photo_verification.html +++ b/lms/templates/verify_student/photo_verification.html @@ -376,8 +376,8 @@

${_("Check Your Name")}

-

${_("Make sure your full name on your {platform_name} account ({full_name}) matches your ID. We will also use this as the name on your certificate.").format( - full_name="{name}".format(name=user_full_name), +

${_(u"Make sure your full name on your {platform_name} account ({full_name}) matches your ID. We will also use this as the name on your certificate.").format( + full_name=u"{name}".format(name=user_full_name), platform_name=settings.PLATFORM_NAME, )}

From 6bfe20b9a9f81e7c23c7e461d7c7bf823ca6d023 Mon Sep 17 00:00:00 2001 From: Chris Dodge Date: Tue, 20 Jan 2015 20:13:59 -0500 Subject: [PATCH 2/2] When changing quantities, be sure to return the new CyberSource submit form html. Also, to ensure that any browser content is fully refreshed when clicking the back button, force a page refresh to reset client state --- lms/djangoapps/shoppingcart/views.py | 14 +++++++++- lms/templates/shoppingcart/shopping_cart.html | 27 +++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/lms/djangoapps/shoppingcart/views.py b/lms/djangoapps/shoppingcart/views.py index f717b182cd..3807befa3b 100644 --- a/lms/djangoapps/shoppingcart/views.py +++ b/lms/djangoapps/shoppingcart/views.py @@ -138,7 +138,19 @@ def update_user_cart(request): old_to_new_id_map = item.order.update_order_type() total_cost = item.order.total_cost - return JsonResponse({"total_cost": total_cost, "oldToNewIdMap": old_to_new_id_map}, 200) + callback_url = request.build_absolute_uri( + reverse("shoppingcart.views.postpay_callback") + ) + cart = Order.get_cart_for_user(request.user) + form_html = render_purchase_form_html(cart, callback_url=callback_url) + + return JsonResponse( + { + "total_cost": total_cost, + "oldToNewIdMap": old_to_new_id_map, + "form_html": form_html, + } + ) return HttpResponseBadRequest('Order item not found in request.') diff --git a/lms/templates/shoppingcart/shopping_cart.html b/lms/templates/shoppingcart/shopping_cart.html index 0fb52a306d..309203662b 100644 --- a/lms/templates/shoppingcart/shopping_cart.html +++ b/lms/templates/shoppingcart/shopping_cart.html @@ -9,6 +9,7 @@ from django.utils.translation import ugettext as _ %> + <%block name="custom_content">
@@ -108,7 +109,9 @@ from django.utils.translation import ugettext as _

% endif - +
+ +