Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
2e334998
Commit
2e334998
authored
Dec 07, 2015
by
David Baumgold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fall back on core asset for footer logo
if the staticfiles finder can't find the one that the footer API returns
parent
a753d1ef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletions
+28
-1
lms/djangoapps/branding/api.py
+28
-1
No files found.
lms/djangoapps/branding/api.py
View file @
2e334998
...
@@ -261,7 +261,34 @@ def _footer_logo_img(is_secure):
...
@@ -261,7 +261,34 @@ def _footer_logo_img(is_secure):
Absolute url to logo
Absolute url to logo
"""
"""
logo_name
=
microsite
.
get_value
(
'FOOTER_ORGANIZATION_IMAGE'
,
settings
.
FOOTER_ORGANIZATION_IMAGE
)
logo_name
=
microsite
.
get_value
(
'FOOTER_ORGANIZATION_IMAGE'
,
settings
.
FOOTER_ORGANIZATION_IMAGE
)
return
_absolute_url_staticfile
(
is_secure
,
logo_name
)
# `logo_name` is looked up from the microsite configuration,
# which falls back on the Django settings, which loads it from
# `lms.env.json`, which is created and managed by Ansible. Because of
# this runaround, we lose a lot of the flexibility that Django's
# staticfiles system provides, and we end up having to hardcode the path
# to the footer logo rather than use the comprehensive theming system.
# EdX needs the FOOTER_ORGANIZATION_IMAGE value to point to edX's
# logo by default, so that it can display properly on edx.org -- both
# within the LMS, and on the Drupal marketing site, which uses this API.
try
:
return
_absolute_url_staticfile
(
is_secure
,
logo_name
)
except
ValueError
:
# However, if the edx.org comprehensive theme is not activated,
# Django's staticfiles system will be unable to find this footer,
# and will throw a ValueError. Since the edx.org comprehensive theme
# is not activated by default, we will end up entering this block
# of code on new Open edX installations, and on sandbox installations.
# We can log when this happens:
default_logo
=
"images/logo.png"
log
.
info
(
"Failed to find footer logo at '
%
s', using '
%
s' instead"
,
logo_name
,
default_logo
,
)
# And we'll use the default logo path of "images/logo.png" instead.
# There is a core asset that corresponds to this logo, so this should
# always succeed.
return
staticfiles_storage
.
url
(
default_logo
)
def
_absolute_url
(
is_secure
,
url_path
):
def
_absolute_url
(
is_secure
,
url_path
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment