From 5802e17cf3ef1e0630f04e0d04c5d8552ca23b3e Mon Sep 17 00:00:00 2001 From: cahrens Date: Thu, 5 Mar 2015 10:50:46 -0500 Subject: [PATCH] Disable new user APIs in production. --- lms/envs/common.py | 3 +++ lms/envs/test.py | 1 + lms/urls.py | 9 ++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lms/envs/common.py b/lms/envs/common.py index c933ef9e44..6f8184ad3c 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -309,6 +309,9 @@ FEATURES = { # Set to True to change the course sorting behavior by their start dates, latest first. 'ENABLE_COURSE_SORTING_BY_START_DATE': False, + # Flag to enable new user account APIs. + 'ENABLE_USER_REST_API': False, + # Expose Mobile REST API. Note that if you use this, you must also set # ENABLE_OAUTH2_PROVIDER to True 'ENABLE_MOBILE_REST_API': False, diff --git a/lms/envs/test.py b/lms/envs/test.py index 9de7b2071a..8b22784449 100644 --- a/lms/envs/test.py +++ b/lms/envs/test.py @@ -265,6 +265,7 @@ FEATURES['ENABLE_OAUTH2_PROVIDER'] = True FEATURES['ENABLE_MOBILE_REST_API'] = True FEATURES['ENABLE_MOBILE_SOCIAL_FACEBOOK_FEATURES'] = True FEATURES['ENABLE_VIDEO_ABSTRACTION_LAYER_API'] = True +FEATURES['ENABLE_USER_REST_API'] = True ###################### Payment ##############################3 # Enable fake payment processing page diff --git a/lms/urls.py b/lms/urls.py index 99d11f5392..ff6918782a 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -60,10 +60,8 @@ urlpatterns = ( url(r'^heartbeat$', include('heartbeat.urls')), - url(r'^api/user/', include('openedx.core.djangoapps.user_api.urls')), - # Note: these are older versions of the User API that will eventually be - # subsumed by api/user. + # subsumed by api/user listed below. url(r'^user_api/', include('openedx.core.djangoapps.user_api.legacy_urls')), url(r'^notifier_api/', include('notifier_api.urls')), @@ -90,6 +88,11 @@ urlpatterns = ( url(r'^api/course_structure/', include('course_structure_api.urls', namespace='course_structure_api')), ) +if settings.FEATURES["ENABLE_USER_REST_API"]: + urlpatterns += ( + url(r'^api/user/', include('openedx.core.djangoapps.user_api.urls')), + ) + if settings.FEATURES["ENABLE_COMBINED_LOGIN_REGISTRATION"]: # Backwards compatibility with old URL structure, but serve the new views urlpatterns += (