diff --git a/cms/djangoapps/contentstore/tests/test_utils.py b/cms/djangoapps/contentstore/tests/test_utils.py index 3b755b0ec2..0757992f2f 100644 --- a/cms/djangoapps/contentstore/tests/test_utils.py +++ b/cms/djangoapps/contentstore/tests/test_utils.py @@ -26,7 +26,7 @@ class LMSLinksTestCase(TestCase): link = utils.get_lms_link_for_item(location, True) self.assertEquals( link, - "//preview.localhost:8000/courses/mitX/101/test/jump_to/i4x://mitX/101/vertical/contacting_us" + "//preview/courses/mitX/101/test/jump_to/i4x://mitX/101/vertical/contacting_us" ) diff --git a/cms/djangoapps/contentstore/utils.py b/cms/djangoapps/contentstore/utils.py index ea3e3ecd6a..35451cf7cc 100644 --- a/cms/djangoapps/contentstore/utils.py +++ b/cms/djangoapps/contentstore/utils.py @@ -88,7 +88,7 @@ def get_lms_link_for_item(location, preview=False, course_id=None): if settings.LMS_BASE is not None: if preview: - lms_base = settings.MITX_FEATURES.get('PREVIEW_LMS_BASE', 'preview.' + settings.LMS_BASE) + lms_base = settings.MITX_FEATURES.get('PREVIEW_LMS_BASE') else: lms_base = settings.LMS_BASE diff --git a/cms/djangoapps/contentstore/views/component.py b/cms/djangoapps/contentstore/views/component.py index 89b5e8bdc7..30005d4524 100644 --- a/cms/djangoapps/contentstore/views/component.py +++ b/cms/djangoapps/contentstore/views/component.py @@ -179,8 +179,7 @@ def edit_unit(request, location): break index = index + 1 - preview_lms_base = settings.MITX_FEATURES.get('PREVIEW_LMS_BASE', - 'preview.' + settings.LMS_BASE) + preview_lms_base = settings.MITX_FEATURES.get('PREVIEW_LMS_BASE') preview_lms_link = '//{preview_lms_base}/courses/{org}/{course}/{course_name}/courseware/{section}/{subsection}/{index}'.format( preview_lms_base=preview_lms_base, diff --git a/cms/envs/aws.py b/cms/envs/aws.py index 9fabb3b9e8..f6064229e6 100644 --- a/cms/envs/aws.py +++ b/cms/envs/aws.py @@ -81,6 +81,7 @@ with open(ENV_ROOT / CONFIG_PREFIX + "env.json") as env_file: ENV_TOKENS = json.load(env_file) LMS_BASE = ENV_TOKENS.get('LMS_BASE') +# Note that MITX_FEATURES['PREVIEW_LMS_BASE'] gets read in from the environment file. SITE_NAME = ENV_TOKENS['SITE_NAME'] diff --git a/cms/envs/common.py b/cms/envs/common.py index 9c02d3d279..90e15186d7 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -39,8 +39,8 @@ MITX_FEATURES = { 'STUDIO_NPS_SURVEY': True, 'SEGMENT_IO': True, - # Enable URL that shows information about the status of variuous services - 'ENABLE_SERVICE_STATUS': False, + # Enable URL that shows information about the status of various services + 'ENABLE_SERVICE_STATUS': False } ENABLE_JASMINE = False diff --git a/cms/envs/dev.py b/cms/envs/dev.py index 9acbf84a95..e63968d338 100644 --- a/cms/envs/dev.py +++ b/cms/envs/dev.py @@ -55,6 +55,7 @@ DATABASES = { } LMS_BASE = "localhost:8000" +MITX_FEATURES['PREVIEW_LMS_BASE'] = "localhost:8000" REPOS = { 'edx4edx': { diff --git a/cms/envs/test.py b/cms/envs/test.py index 6d78b0d7d6..8a3f9ba158 100644 --- a/cms/envs/test.py +++ b/cms/envs/test.py @@ -82,6 +82,7 @@ DATABASES = { } LMS_BASE = "localhost:8000" +MITX_FEATURES['PREVIEW_LMS_BASE'] = "preview" CACHES = { # This is the cache used for most things. Askbot will not work without a