Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
9f30a75a
Commit
9f30a75a
authored
7 years ago
by
Troy Sankey
Browse files
Options
Downloads
Patches
Plain Diff
add missing maintenance banner settings
parent
97151ae4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/envs/aws.py
+3
-0
3 additions, 0 deletions
lms/envs/aws.py
openedx/core/djangoapps/util/maintenance_banner.py
+2
-2
2 additions, 2 deletions
openedx/core/djangoapps/util/maintenance_banner.py
with
5 additions
and
2 deletions
lms/envs/aws.py
+
3
−
0
View file @
9f30a75a
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/util/maintenance_banner.py
+
2
−
2
View file @
9f30a75a
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment