I'm only going to create one course mode per course, in "honor" mode and in usd, with min_price being the actual price we'll charge.
For now, I only want to use 1 type of currency across a platform installation for PaidCourseRegistration mode, so that's why I'm filtering on currency.
I'm using filter instead of get because I'd rather get an empty list back when nothing is found rather than an exception.  The empty list can be directly given to the template, which will know what to do with it, without having to write exception handlers.



On Sep 25, 2013, at 6:41 AM, Diana Huang <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))
> I'm a little confused by how the course modes are going to be set up for this feature. I think originally we wanted it so that each course mode would only have one entry in the table per course. I'm open to using them more flexibly, but I'm a little confused by what you're doing here.
> 
> —
> Reply to this email directly or view it on GitHub.
>