Commit 9513df1e by stv

Merge branch 'rc' into release

parents 9c2c8d54 44df10fb
...@@ -394,8 +394,8 @@ class ShibSPTest(ModuleStoreTestCase): ...@@ -394,8 +394,8 @@ class ShibSPTest(ModuleStoreTestCase):
'?course_id=MITx/999/course/Robot_Super_Course' + '?course_id=MITx/999/course/Robot_Super_Course' +
'&enrollment_action=enroll') '&enrollment_action=enroll')
login_response = course_specific_login(login_request, SlashSeparatedCourseKey('MITx', '999', 'Robot_Super_Course')) login_response = course_specific_login(login_request, 'MITx/999/Robot_Super_Course')
reg_response = course_specific_register(login_request, SlashSeparatedCourseKey('MITx', '999', 'Robot_Super_Course')) reg_response = course_specific_register(login_request, 'MITx/999/Robot_Super_Course')
if "shib" in domain: if "shib" in domain:
self.assertIsInstance(login_response, HttpResponseRedirect) self.assertIsInstance(login_response, HttpResponseRedirect)
...@@ -429,8 +429,8 @@ class ShibSPTest(ModuleStoreTestCase): ...@@ -429,8 +429,8 @@ class ShibSPTest(ModuleStoreTestCase):
'?course_id=DNE/DNE/DNE/Robot_Super_Course' + '?course_id=DNE/DNE/DNE/Robot_Super_Course' +
'&enrollment_action=enroll') '&enrollment_action=enroll')
login_response = course_specific_login(login_request, SlashSeparatedCourseKey('DNE', 'DNE', 'DNE')) login_response = course_specific_login(login_request, 'DNE/DNE/DNE')
reg_response = course_specific_register(login_request, SlashSeparatedCourseKey('DNE', 'DNE', 'DNE')) reg_response = course_specific_register(login_request, 'DNE/DNE/DNE')
self.assertIsInstance(login_response, HttpResponseRedirect) self.assertIsInstance(login_response, HttpResponseRedirect)
self.assertEqual(login_response['Location'], self.assertEqual(login_response['Location'],
......
...@@ -49,6 +49,7 @@ from xmodule.modulestore.django import modulestore ...@@ -49,6 +49,7 @@ from xmodule.modulestore.django import modulestore
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
from xmodule.modulestore import Location from xmodule.modulestore import Location
from xmodule.modulestore.exceptions import ItemNotFoundError from xmodule.modulestore.exceptions import ItemNotFoundError
from xmodule.modulestore.locations import SlashSeparatedCourseKey
log = logging.getLogger("edx.external_auth") log = logging.getLogger("edx.external_auth")
AUDIT_LOG = logging.getLogger("audit") AUDIT_LOG = logging.getLogger("audit")
...@@ -589,7 +590,8 @@ def course_specific_login(request, course_id): ...@@ -589,7 +590,8 @@ def course_specific_login(request, course_id):
Dispatcher function for selecting the specific login method Dispatcher function for selecting the specific login method
required by the course required by the course
""" """
course = modulestore().get_course(course_id) course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
course = modulestore().get_course(course_key)
if not course: if not course:
# couldn't find the course, will just return vanilla signin page # couldn't find the course, will just return vanilla signin page
return redirect_with_get('signin_user', request.GET) return redirect_with_get('signin_user', request.GET)
...@@ -607,7 +609,8 @@ def course_specific_register(request, course_id): ...@@ -607,7 +609,8 @@ def course_specific_register(request, course_id):
Dispatcher function for selecting the specific registration method Dispatcher function for selecting the specific registration method
required by the course required by the course
""" """
course = modulestore().get_course(course_id) course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
course = modulestore().get_course(course_key)
if not course: if not course:
# couldn't find the course, will just return vanilla registration page # couldn't find the course, will just return vanilla registration page
......
...@@ -768,7 +768,7 @@ def accounts_login(request): ...@@ -768,7 +768,7 @@ def accounts_login(request):
if redirect_to: if redirect_to:
course_id = _parse_course_id_from_string(redirect_to) course_id = _parse_course_id_from_string(redirect_to)
if course_id and _get_course_enrollment_domain(course_id): if course_id and _get_course_enrollment_domain(course_id):
return external_auth.views.course_specific_login(request, course_id) return external_auth.views.course_specific_login(request, course_id.to_deprecated_string())
context = { context = {
'pipeline_running': 'false', 'pipeline_running': 'false',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment