mitocw/edx-platform — pull request #3 by ichuang (2014-08-31 02:35:55+00:00)
Title: add @login_required to student.views.change_enrollment

On residential MITx (rp), the registration page currently doesn't work properly, if the user is not logged in. Clicking the "register" button just keeps on cycling back to the registration page, without triggering a login.

What happens is that the "register" button does an AJAX POST to /change_enrollment, which calls student.views.change_enrollment ; if the user is not logged in, it throws a 403. That 403 is supposed to cause a redirect to the login page, but that's not happening.

This attempted fix short circuits this by adding `@login_required` to student.views.change_enrollment ; the login should automagically happen for users who have MIT client certificates.

Note: needs to be tested before deployment

@carsongee