Enter the new verification / payment flow using a GET param

Allow disabling of experiment
This commit is contained in:
Will Daly
2014-12-29 16:33:42 -08:00
parent 234691e446
commit a90f7ab1bf
10 changed files with 92 additions and 29 deletions

View File

@@ -55,6 +55,16 @@ class ChooseModeView(View):
upgrade = request.GET.get('upgrade', False)
request.session['attempting_upgrade'] = upgrade
# TODO (ECOM-188): Once the A/B test of decoupled/verified flows
# completes, we can remove this flag.
# The A/B test framework will reload the page with the ?separate-verified GET param
# set if the user is in the experimental condition. We then store this flag
# in a session variable so downstream views can check it.
if request.GET.get('separate-verified', False):
request.session['separate-verified'] = True
elif request.GET.get('disable-separate-verified', False) and 'separate-verified' in request.session:
del request.session['separate-verified']
enrollment_mode, is_active = CourseEnrollment.enrollment_mode_for_user(request.user, course_key)
modes = CourseMode.modes_for_course_dict(course_key)
@@ -63,7 +73,9 @@ class ChooseModeView(View):
# to the usual "choose your track" page.
has_enrolled_professional = (enrollment_mode == "professional" and is_active)
if "professional" in modes and not has_enrolled_professional:
if settings.FEATURES.get('SEPARATE_VERIFICATION_FROM_PAYMENT'):
# TODO (ECOM-188): Once the A/B test of separating verification / payment completes,
# we can remove the check for the session variable.
if settings.FEATURES.get('SEPARATE_VERIFICATION_FROM_PAYMENT') and request.session.get('separate-verified', False):
return redirect(
reverse(
'verify_student_start_flow',
@@ -180,7 +192,9 @@ class ChooseModeView(View):
donation_for_course[unicode(course_key)] = amount_value
request.session["donation_for_course"] = donation_for_course
if settings.FEATURES.get('SEPARATE_VERIFICATION_FROM_PAYMENT'):
# TODO (ECOM-188): Once the A/B test of separate verification flow completes,
# we can remove the check for the session variable.
if settings.FEATURES.get('SEPARATE_VERIFICATION_FROM_PAYMENT') and request.session.get('separate-verified', False):
return redirect(
reverse(
'verify_student_start_flow',