Commit 9f40263f by David Ormsbee

Fix broken callout to template partial from receipt page.

parent 48f867bd
......@@ -204,7 +204,15 @@ class OrderItem(models.Model):
"""
The template that should be used when there's only one item in the order
"""
return'shoppingcart/receipt.html'
return 'shoppingcart/receipt.html'
@property
def single_item_receipt_context(self):
"""
Extra variables needed to render the template specified in
`single_item_receipt_template`
"""
return {}
@property
def additional_instruction_text(self):
......@@ -373,6 +381,10 @@ class CertificateItem(OrderItem):
return super(CertificateItem, self).single_item_receipt_template
@property
def single_item_receipt_context(self):
return {"course_name": course_from_id(self.course_id).display_name}
@property
def additional_instruction_text(self):
return textwrap.dedent(
_("Note - you have up to 2 weeks into the course to unenroll from the Verified Certificate option \
......
......@@ -105,8 +105,14 @@ def show_receipt(request, ordernum):
receipt_template = 'shoppingcart/receipt.html'
# we want to have the ability to override the default receipt page when
# there is only one item in the order
context = {
'order': order,
'order_items': order_items,
'any_refunds': any_refunds
}
if order_items.count() == 1:
receipt_template = order_items[0].single_item_receipt_template
return render_to_response(receipt_template, {'order': order,
'order_items': order_items,
'any_refunds': any_refunds})
context.update(order_items[0].single_item_receipt_context)
return render_to_response(receipt_template, context)
......@@ -19,7 +19,7 @@
<section class="wrapper cart-list">
<%include file="_verification_header.html" />
<%include file="/verify_student/_verification_header.html" args="course_name=course_name" />
<div class="wrapper-progress">
<section class="progress">
......
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