'Takes the form submission from the page and parses it.
Args:
request (`Request`): The Django Request object.
course_id (unicode): The slash-separated course key.
Returns:
Status code 400 when the requested mode is unsupported. When the honor mode
is selected, redirects to the dashboard. When the verified mode is selected,
returns error messages if the indicated contribution amount is invalid or
below the minimum, otherwise redirects to the verification flow.'

@method_decorator(tpa_hint_ends_existing_session)
@method_decorator(transaction.non_atomic_requests)
@method_decorator(login_required)
@method_decorator(outer_atomic(read_committed=True))
def post(self, request, course_id):

    course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
    user = request.user
    course = modulestore().get_course(course_key)
    if (not has_access(user, 'enroll', course)):
        error_msg = _('Enrollment    is    closed')
        return self.get(request, course_id, error=error_msg)
    requested_mode = self._get_requested_mode(request.POST)
    allowed_modes = CourseMode.modes_for_course_dict(course_key)
    if (requested_mode not in allowed_modes):
        return HttpResponseBadRequest(_('Enrollment    mode    not    supported'))
    if (requested_mode == 'audit'):
        CourseEnrollment.enroll(request.user, course_key, CourseMode.AUDIT)
        return redirect(reverse('dashboard'))
    if (requested_mode == 'honor'):
        CourseEnrollment.enroll(user, course_key, mode=requested_mode)
        return redirect(reverse('dashboard'))
    mode_info = allowed_modes[requested_mode]
    if (requested_mode == 'verified'):
        amount = (request.POST.get('contribution') or request.POST.get('contribution-other-amt') or 0)
        try:
            amount_value = decimal.Decimal(amount).quantize(decimal.Decimal('.01'), rounding=decimal.ROUND_DOWN)
        except decimal.InvalidOperation:
            error_msg = _('Invalid    amount    selected.')
            return self.get(request, course_id, error=error_msg)
        if (amount_value < mode_info.min_price):
            error_msg = _('No    selected    price    or    selected    price    is    too    low.')
            return self.get(request, course_id, error=error_msg)
        donation_for_course = request.session.get('donation_for_course', {})
        donation_for_course[unicode(course_key)] = amount_value
        request.session['donation_for_course'] = donation_for_course
        return redirect(reverse('verify_student_start_flow', kwargs={'course_id': unicode(course_key)}))
