Actually, we're using enrollment_end  as access control right now.  We set it in the past so that normal registration flows (in student.views) don't work, but this does enroll them.

In further detail: student.views.change_enrollment has this check:
        if not has_access(user, course, 'enroll'):
            return HttpResponseBadRequest(_("Enrollment is closed"))

But this flow doesn't, which is why it works.

I understand that it's somewhat hacky, and would it be good to make it more straightforward, but I'm guessing there's other code that depends on exceptional enrollment being possible of the enrollment_period and I don't want to take up that refactor right now.

On Sep 25, 2013, at 12:39 PM, Jay Zoldak <notifications@github.com> wrote:

> In lms/djangoapps/courseware/views.py:
> 
> > @@ -604,10 +605,31 @@ def course_about(request, course_id):
> >      show_courseware_link = (has_access(request.user, course, 'load') or
> >                              settings.MITX_FEATURES.get('ENABLE_LMS_MIGRATION'))
> >  
> > +    # Note: this is a flow for payment for course registration, not the Verified Certificate flow.
> > +    registration_prices = []
> > +    in_cart = False
> > +    reg_then_add_to_cart_link = ""
> > +    if settings.MITX_FEATURES.get('ENABLE_PAID_COURSE_REGISTRATION'):
> > +        registration_prices = (CourseMode.objects
> > +                               .filter(course_id=course_id,
> > +                                       currency=settings.PAID_COURSE_REGISTRATION_CURRENCY[0],
> > +                                       mode_slug=CourseMode.DEFAULT_MODE_SLUG,)
> > +                               .values_list('min_price', flat=True))
> Similarly, what will happen if the course is in their cart, but the registration end date has passed? Will it charge the student, but fail enrolling them in the course?
> 
> —
> Reply to this email directly or view it on GitHub.
>