diff --git a/lms/envs/common.py b/lms/envs/common.py index 8654b5ebf5..efc8a382d7 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -71,6 +71,8 @@ MITX_FEATURES = { 'ENABLE_LMS_MIGRATION': False, 'ENABLE_MANUAL_GIT_RELOAD': False, + 'ENABLE_MASQUERADE': True, # allow course staff to change to student view of courseware + 'DISABLE_LOGIN_BUTTON': False, # used in systems where login is automatic, eg MIT SSL 'STUB_VIDEO_FOR_TESTING': False, # do not display video when running automated acceptance tests diff --git a/lms/urls.py b/lms/urls.py index 4a0608720a..c792c149e1 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -201,9 +201,6 @@ if settings.WIKI_ENABLED: if settings.COURSEWARE_ENABLED: urlpatterns += ( - # Hook django-masquerade, allowing staff to view site as other users - url(r'^masquerade/', include('masquerade.urls')), - url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/jump_to/(?P.*)$', 'courseware.views.jump_to', name="jump_to"), url(r'^courses/(?P[^/]+/[^/]+/[^/]+)/modx/(?P.*?)/(?P[^/]*)$', @@ -345,6 +342,13 @@ if settings.COURSEWARE_ENABLED: 'open_ended_grading.views.peer_grading', name='peer_grading'), ) + # allow course staff to change to student view of courseware + if settings.MITX_FEATURES.get('ENABLE_MASQUERADE'): + urlpatterns += ( + url(r'^masquerade/(?P.*)$','courseware.masquerade.handle_ajax', name="masquerate-switch"), + ) + + # discussion forums live within courseware, so courseware must be enabled first if settings.MITX_FEATURES.get('ENABLE_DISCUSSION_SERVICE'): urlpatterns += (