Commit cfc3b46c by Diana Huang

Allow verified to be offered without audit

parent 44c41020
......@@ -60,6 +60,7 @@ class ChooseModeView(View):
"chosen_price": chosen_price,
"error": error,
"upgrade": upgrade,
"can_audit": "audit" in modes,
}
if "verified" in modes:
context["suggested_prices"] = [
......
......@@ -632,10 +632,16 @@ def change_enrollment(request):
available_modes = CourseMode.modes_for_course(course_id)
if len(available_modes) > 1:
return HttpResponse(
reverse("course_modes_choose", kwargs={'course_id': course_id.to_deprecated_string()})
reverse("course_modes_choose", kwargs={'course_id': unicode(course_id)})
)
current_mode = available_modes[0]
# only automatically enroll people if the only mode is 'honor'
if current_mode.slug != 'honor':
return HttpResponse(
reverse("course_modes_choose", kwargs={'course_id': unicode(course_id)})
)
CourseEnrollment.enroll(user, course.id, mode=current_mode.slug)
return HttpResponse()
......
......@@ -74,7 +74,8 @@ class VerifyView(View):
# bookkeeping-wise just to start over.
progress_state = "start"
verify_mode = CourseMode.mode_for_course(course_id, "verified")
modes_dict = CourseMode.modes_for_course_dict(course_id)
verify_mode = modes_dict['verified']
# if the course doesn't have a verified mode, we want to kick them
# from the flow
if not verify_mode:
......@@ -102,6 +103,7 @@ class VerifyView(View):
"chosen_price": chosen_price,
"min_price": verify_mode.min_price,
"upgrade": upgrade,
"can_audit": "audit" in modes_dict,
}
return render_to_response('verify_student/photo_verification.html', context)
......@@ -121,7 +123,9 @@ class VerifiedView(View):
course_id = SlashSeparatedCourseKey.from_deprecated_string(course_id)
if CourseEnrollment.enrollment_mode_for_user(request.user, course_id) == ('verified', True):
return redirect(reverse('dashboard'))
verify_mode = CourseMode.mode_for_course(course_id, "verified")
modes_dict = CourseMode.modes_for_course_dict(course_id)
verify_mode = modes_dict['verified']
if verify_mode is None:
return redirect(reverse('dashboard'))
......@@ -146,6 +150,7 @@ class VerifiedView(View):
"chosen_price": chosen_price,
"create_order_url": reverse("verify_student_create_order"),
"upgrade": upgrade,
"can_audit": "audit" in modes_dict,
}
return render_to_response('verify_student/verified.html', context)
......
......@@ -10,6 +10,7 @@
</div>
</li>
%if can_audit:
<li class="help-item help-item-coldfeet">
%if upgrade:
<h3 class="title">${_("Change your mind?")}</h3>
......@@ -23,6 +24,7 @@
</div>
%endif
</li>
%endif
<li class="help-item help-item-technical">
<h3 class="title">${_("Technical Requirements")}</h3>
......
......@@ -156,11 +156,13 @@
<nav class="nav-wizard ${"is-not-ready" if is_not_active else "is-ready"}">
%if can_audit:
%if upgrade:
<span class="help help-inline">${_("Missing something? You can always continue to audit this course instead.")}</span>
%else:
<span class="help help-inline">${_("Missing something? You can always {a_start}audit this course instead{a_end}").format(a_start='<a href="{}">'.format(course_modes_choose_url), a_end="</a>")}</span>
%endif
%endif
<ol class="wizard-steps">
<li class="wizard-step">
......
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