add missing maintenance banner settings

This commit is contained in:
Troy Sankey
2018-03-23 12:15:52 -04:00
parent 97151ae4f4
commit 9f30a75a08
2 changed files with 5 additions and 2 deletions

View File

@@ -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