This adds the following new waffle switch (and namespace): open_edx_util.display_maintenance_warning and a new setting: settings.MAINTENANCE_BANNER_TEXT The provided view decorator allows developers to select which views receive the static banner, and the banner can be globally toggled via the waffle switch. The text of the banner is determined by the setting, which is currently not translated.
19 lines
449 B
Python
19 lines
449 B
Python
"""
|
|
Waffle flags and switches
|
|
"""
|
|
from __future__ import absolute_import
|
|
|
|
from openedx.core.djangoapps.waffle_utils import WaffleSwitchNamespace
|
|
|
|
WAFFLE_NAMESPACE = u'open_edx_util'
|
|
|
|
# Switches
|
|
DISPLAY_MAINTENANCE_WARNING = u'display_maintenance_warning'
|
|
|
|
|
|
def waffle():
|
|
"""
|
|
Returns the namespaced, cached, audited Waffle class for open_edx_util.
|
|
"""
|
|
return WaffleSwitchNamespace(name=WAFFLE_NAMESPACE, log_prefix=u'OpenEdX Util: ')
|