From 9f30a75a085e9823a10cf634d126f2e8220c772b Mon Sep 17 00:00:00 2001 From: Troy Sankey Date: Fri, 23 Mar 2018 12:15:52 -0400 Subject: [PATCH] add missing maintenance banner settings --- lms/envs/aws.py | 3 +++ openedx/core/djangoapps/util/maintenance_banner.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lms/envs/aws.py b/lms/envs/aws.py index 7546c9a0ed..db1b6b10e3 100644 --- a/lms/envs/aws.py +++ b/lms/envs/aws.py @@ -1091,6 +1091,9 @@ COMPLETION_BY_VIEWING_DELAY_MS = ENV_TOKENS.get('COMPLETION_BY_VIEWING_DELAY_MS' ############### Settings for django-fernet-fields ################## FERNET_KEYS = AUTH_TOKENS.get('FERNET_KEYS', FERNET_KEYS) +################# Settings for the maintenance banner ################# +MAINTENANCE_BANNER_TEXT = ENV_TOKENS.get('MAINTENANCE_BANNER_TEXT', None) + ############################### Plugin Settings ############################### from openedx.core.djangoapps.plugins import plugin_settings, constants as plugin_constants diff --git a/openedx/core/djangoapps/util/maintenance_banner.py b/openedx/core/djangoapps/util/maintenance_banner.py index cab008e0ec..e4eb9bbae4 100644 --- a/openedx/core/djangoapps/util/maintenance_banner.py +++ b/openedx/core/djangoapps/util/maintenance_banner.py @@ -35,9 +35,9 @@ def add_maintenance_banner(func): @wraps(func) def _decorated(request, *args, **kwargs): # pylint: disable=missing-docstring if waffle().is_enabled(DISPLAY_MAINTENANCE_WARNING): - if hasattr(settings, 'EDXAPP_MAINTENANCE_BANNER_TEXT') and settings.EDXAPP_MAINTENANCE_BANNER_TEXT: + if hasattr(settings, 'MAINTENANCE_BANNER_TEXT') and settings.MAINTENANCE_BANNER_TEXT: # The waffle switch is enabled and the banner text is defined # and non-empty. We can now register the message: - PageLevelMessages.register_warning_message(request, settings.EDXAPP_MAINTENANCE_BANNER_TEXT) + PageLevelMessages.register_warning_message(request, settings.MAINTENANCE_BANNER_TEXT) return func(request, *args, **kwargs) return _decorated