diff --git a/common/djangoapps/edxmako/shortcuts.py b/common/djangoapps/edxmako/shortcuts.py index a52c852727..d70e2145dd 100644 --- a/common/djangoapps/edxmako/shortcuts.py +++ b/common/djangoapps/edxmako/shortcuts.py @@ -37,13 +37,18 @@ def marketing_link(name): # link_map maps URLs from the marketing site to the old equivalent on # the Django site link_map = settings.MKTG_URL_LINK_MAP - if settings.FEATURES.get('ENABLE_MKTG_SITE') and name in settings.MKTG_URLS: + enable_mktg_site = MicrositeConfiguration.get_microsite_configuration_value( + 'ENABLE_MKTG_SITE', + settings.FEATURES.get('ENABLE_MKTG_SITE', False) + ) + + if enable_mktg_site and name in settings.MKTG_URLS: # special case for when we only want the root marketing URL if name == 'ROOT': return settings.MKTG_URLS.get('ROOT') return settings.MKTG_URLS.get('ROOT') + settings.MKTG_URLS.get(name) # only link to the old pages when the marketing site isn't on - elif not settings.FEATURES.get('ENABLE_MKTG_SITE') and name in link_map: + elif not enable_mktg_site and name in link_map: # don't try to reverse disabled marketing links if link_map[name] is not None: return reverse(link_map[name]) diff --git a/lms/djangoapps/branding/views.py b/lms/djangoapps/branding/views.py index aa0f752e7d..fdbacdec53 100644 --- a/lms/djangoapps/branding/views.py +++ b/lms/djangoapps/branding/views.py @@ -59,7 +59,10 @@ def courses(request): to that. Otherwise, if subdomain branding is on, this is the university profile page. Otherwise, it's the edX courseware.views.courses page """ - enable_mktg_site = settings.FEATURES.get('ENABLE_MKTG_SITE') or MicrositeConfiguration.get_microsite_configuration_value('ENABLE_MKTG_SITE', False) + enable_mktg_site = MicrositeConfiguration.get_microsite_configuration_value( + 'ENABLE_MKTG_SITE', + settings.FEATURES.get('ENABLE_MKTG_SITE', False) + ) if enable_mktg_site: return redirect(marketing_link('COURSES'), permanent=True) diff --git a/lms/djangoapps/courseware/views.py b/lms/djangoapps/courseware/views.py index 137b529169..e60b6c5394 100644 --- a/lms/djangoapps/courseware/views.py +++ b/lms/djangoapps/courseware/views.py @@ -38,6 +38,8 @@ from xmodule.modulestore.search import path_to_location from xmodule.course_module import CourseDescriptor import shoppingcart +from microsite_configuration.middleware import MicrositeConfiguration + log = logging.getLogger("edx.courseware") template_imports = {'urllib': urllib} @@ -514,7 +516,11 @@ def registered_for_course(course, user): @ensure_csrf_cookie @cache_if_anonymous def course_about(request, course_id): - if settings.FEATURES.get('ENABLE_MKTG_SITE', False): + + if MicrositeConfiguration.get_microsite_configuration_value( + 'ENABLE_MKTG_SITE', + settings.FEATURES.get('ENABLE_MKTG_SITE', False) + ): raise Http404 course = get_course_with_access(request.user, course_id, 'see_exists') diff --git a/lms/envs/cms/microsite_test.py b/lms/envs/cms/microsite_test.py index 511b97e66a..700e7c6c16 100644 --- a/lms/envs/cms/microsite_test.py +++ b/lms/envs/cms/microsite_test.py @@ -27,7 +27,7 @@ MICROSITE_CONFIGURATION = { "course_index_overlay_text": "Explore free courses from leading universities.", "course_index_overlay_logo_file": "openedx/images/header-logo.png", "homepage_overlay_html": "