Commit 2e3a918d by Diana Huang

Clean up and fix some bugs on the 'already verified' page.

parent 18a497e1
......@@ -107,12 +107,17 @@ def create_order(request):
course_id = request.POST['course_id']
donation_for_course = request.session.get('donation_for_course', {})
current_donation = donation_for_course.get(course_id, decimal.Decimal(0))
contribution = request.POST.get("contribution", donation_for_course.get(course_id, 0))
try:
amount = decimal.Decimal(contribution).quantize(decimal.Decimal('.01'), rounding=decimal.ROUND_DOWN)
except decimal.InvalidOperation:
return HttpResponseBadRequest(_("Selected price is not valid number."))
if amount != current_donation:
donation_for_course[course_id] = amount
request.session['donation_for_course'] = donation_for_course
verified_mode = CourseMode.modes_for_course_dict(course_id).get('verified', None)
# make sure this course has a verified mode
......
......@@ -139,7 +139,7 @@
</ul>
<nav class="nav-wizard ${"is-not-ready" if is_not_active else "is-ready"}">
<span class="help help-inline">${_("Missing something? You can always {a_start} audit this course instead {a_end}").format(a_start='<a href="/course_modes/choose/${course_id}">', a_end="</a>")}</span>
<span class="help help-inline">${_("Missing something? You can always {a_start} audit this course instead {a_end}").format(a_start='<a href="/course_modes/choose/' + course_id + '">', a_end="</a>")}</span>
<ol class="wizard-steps">
<li class="wizard-step">
......
......@@ -11,7 +11,7 @@
var submitToPaymentProcessing = function(event) {
event.preventDefault();
var xhr = $.post(
"create_order",
"/verify_student/create_order",
{
"course_id" : "${course_id}",
},
......
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