From be088dd9246a3ed4728ad73b58758b5504f0adff Mon Sep 17 00:00:00 2001 From: Jillian Vogel Date: Fri, 10 Mar 2017 19:36:04 +1030 Subject: [PATCH] Adds settings.ENTERPRISE_PUBLIC_ENROLLMENT_API_URL which is used for external, client-side requests by the Enterprise app to the Enrollments API. This allows ENTERPRISE_ENROLLMENT_API_URL to use localhost:8000, to be used for internal, server-side requests. Bumps edx-enterprise version to 0.27.4 to use this change. --- lms/envs/aws.py | 12 ++++++++++-- lms/envs/common.py | 1 + requirements/edx/base.txt | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 72f912e749..e05f15594d 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -904,7 +904,15 @@ DOC_LINK_BASE_URL = ENV_TOKENS.get('DOC_LINK_BASE_URL', DOC_LINK_BASE_URL) ############## Settings for the Enterprise App ###################### -ENTERPRISE_ENROLLMENT_API_URL = ENV_TOKENS.get( - 'ENTERPRISE_ENROLLMENT_API_URL', +# Publicly-accessible enrollment URL, for use on the client side. +ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENV_TOKENS.get( + 'ENTERPRISE_PUBLIC_ENROLLMENT_API_URL', (LMS_ROOT_URL or '') + '/api/enrollment/v1/' ) + +# Enrollment URL used on the server-side. +# If not overridden in ENV_TOKENS, then fallback to the value set in env/common.py +ENTERPRISE_ENROLLMENT_API_URL = ENV_TOKENS.get( + 'ENTERPRISE_ENROLLMENT_API_URL', + ENTERPRISE_ENROLLMENT_API_URL +) diff --git a/lms/envs/common.py b/lms/envs/common.py index eb8c3020d5..6712bef1f8 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -3062,3 +3062,4 @@ DOC_LINK_BASE_URL = None ############## Settings for the Enterprise App ###################### ENTERPRISE_ENROLLMENT_API_URL = LMS_ROOT_URL + "/api/enrollment/v1/" +ENTERPRISE_PUBLIC_ENROLLMENT_API_URL = ENTERPRISE_ENROLLMENT_API_URL diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index f5455c8fa5..0221ea404e 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -52,7 +52,7 @@ edx-lint==0.4.3 astroid==1.3.8 edx-django-oauth2-provider==1.1.4 edx-django-sites-extensions==2.1.1 -edx-enterprise==0.27.3 +edx-enterprise==0.27.4 edx-oauth2-provider==1.2.0 edx-opaque-keys==0.4.0 edx-organizations==0.4.3