Skip to content
Snippets Groups Projects
Commit 9f30a75a authored by Troy Sankey's avatar Troy Sankey
Browse files

add missing maintenance banner settings

parent 97151ae4
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment