From 03b189fc7c31b3e626c9a199cd9083fe514509bf Mon Sep 17 00:00:00 2001
From: Yagnesh1998 <127923546+Yagnesh1998@users.noreply.github.com>
Date: Wed, 19 Jul 2023 20:24:29 +0530
Subject: [PATCH] feat: Remove FOOTER_ORGANIZATION_IMAGE django settings depr52
(#32757)
* feat: Remove FOOTER_ORGANIZATION_IMAGE django settings depr52
* feat: Update api.py
* feat: Update api.py
* feat: Update footer.html
* feat: change in logo images path
* feat: Update footer.html
as per Diana's suggestion white space is removed.
---
cms/envs/common.py | 4 ----
cms/envs/devstack-experimental.yml | 1 -
lms/djangoapps/branding/api.py | 11 -----------
lms/djangoapps/branding/tests/test_api.py | 2 +-
lms/envs/common.py | 4 ----
lms/envs/devstack-experimental.yml | 1 -
lms/templates/footer.html | 9 +--------
7 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/cms/envs/common.py b/cms/envs/common.py
index bed1862fab..ba6918f0e5 100644
--- a/cms/envs/common.py
+++ b/cms/envs/common.py
@@ -616,10 +616,6 @@ SOCIAL_SHARING_SETTINGS = {
'DASHBOARD_TWITTER': False
}
-# This is just a placeholder image.
-# Site operators can customize this with their organization's image.
-FOOTER_ORGANIZATION_IMAGE = "images/logo.png"
-
############################# SET PATH INFORMATION #############################
PROJECT_ROOT = path(__file__).abspath().dirname().dirname() # /edx-platform/cms
REPO_ROOT = PROJECT_ROOT.dirname()
diff --git a/cms/envs/devstack-experimental.yml b/cms/envs/devstack-experimental.yml
index 7d8407f391..6a1d0ec14a 100644
--- a/cms/envs/devstack-experimental.yml
+++ b/cms/envs/devstack-experimental.yml
@@ -303,7 +303,6 @@ FINANCIAL_REPORTS:
BUCKET: null
ROOT_PATH: sandbox
STORAGE_TYPE: localfs
-FOOTER_ORGANIZATION_IMAGE: images/logo.png
GITHUB_REPO_ROOT: /edx/var/edxapp/data
GIT_REPO_EXPORT_DIR: /edx/var/edxapp/export_course_repos
GOOGLE_ANALYTICS_ACCOUNT: null
diff --git a/lms/djangoapps/branding/api.py b/lms/djangoapps/branding/api.py
index b7eb12c4bd..52aeb9b3e1 100644
--- a/lms/djangoapps/branding/api.py
+++ b/lms/djangoapps/branding/api.py
@@ -465,29 +465,18 @@ def _footer_logo_img(is_secure):
"""
default_local_path = 'images/logo.png'
brand_footer_logo_url = settings.LOGO_TRADEMARK_URL
- footer_url_from_site_config = configuration_helpers.get_value(
- 'FOOTER_ORGANIZATION_IMAGE',
- settings.FOOTER_ORGANIZATION_IMAGE
- )
-
# `logo_name` is looked up from the configuration,
# which falls back on the Django settings, which loads it from
# `lms.yml`, 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.
- if footer_url_from_site_config:
- return _absolute_url_staticfile(is_secure, footer_url_from_site_config)
-
if brand_footer_logo_url:
return brand_footer_logo_url
log.info(
- "Failed to find footer logo at '%s', using '%s' instead",
- footer_url_from_site_config,
default_local_path,
)
diff --git a/lms/djangoapps/branding/tests/test_api.py b/lms/djangoapps/branding/tests/test_api.py
index cd66ec3e7c..71819a98d9 100644
--- a/lms/djangoapps/branding/tests/test_api.py
+++ b/lms/djangoapps/branding/tests/test_api.py
@@ -159,7 +159,7 @@ class TestFooter(TestCase):
'name': 'reddit', 'icon-class': 'fa-reddit-square', 'title': 'Reddit'}
],
'mobile_links': [],
- 'logo_image': 'https://edx.org/static/images/logo.png',
+ 'logo_image': '/static/images/logo.png',
'openedx_link': {
'url': 'https://open.edx.org',
'image': 'https://logos.openedx.org/open-edx-logo-tag.png',
diff --git a/lms/envs/common.py b/lms/envs/common.py
index 95bfc26c10..02fabfad2a 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -2098,10 +2098,6 @@ FOOTER_OPENEDX_URL = "https://open.edx.org"
# * https://logos.openedx.org/open-edx-logo-tag-dark.png
FOOTER_OPENEDX_LOGO_IMAGE = "https://logos.openedx.org/open-edx-logo-tag.png"
-# This is just a placeholder image.
-# Site operators can customize this with their organization's image.
-FOOTER_ORGANIZATION_IMAGE = "images/logo.png"
-
# These are referred to both by the Django asset pipeline
# AND by the branding footer API, which needs to decide which
# version of the CSS to serve.
diff --git a/lms/envs/devstack-experimental.yml b/lms/envs/devstack-experimental.yml
index 1eb881caca..98b11750df 100644
--- a/lms/envs/devstack-experimental.yml
+++ b/lms/envs/devstack-experimental.yml
@@ -335,7 +335,6 @@ FINANCIAL_REPORTS:
BUCKET: null
ROOT_PATH: sandbox
STORAGE_TYPE: localfs
-FOOTER_ORGANIZATION_IMAGE: images/logo.png
GITHUB_REPO_ROOT: /edx/var/edxapp/data
GIT_REPO_DIR: /edx/var/edxapp/course_repos
GOOGLE_ANALYTICS_ACCOUNT: null
diff --git a/lms/templates/footer.html b/lms/templates/footer.html
index ca10e0bbb4..f996030a71 100644
--- a/lms/templates/footer.html
+++ b/lms/templates/footer.html
@@ -30,16 +30,13 @@
## The default logo is a placeholder.
## You can either replace this link entirely or update
- ## the FOOTER_ORGANIZATION_IMAGE in Django settings.
- ## If you customize FOOTER_ORGANIZATION_IMAGE, then the image
## can be included in the footer on other sites
## (e.g. a blog or marketing front-end) to provide a consistent
## user experience. See the branding app for details.
${footer['copyright']} % if icp_license_info.get('icp_license'): @@ -105,14 +102,11 @@ % if context.get('include_language_selector', footer_language_selector_is_enabled()): <%include file="${static.get_template_path('widgets/footer-language-selector.html')}"/> % endif -
- ## Site operators: Please do not remove this paragraph! This attributes back to edX and makes your acknowledgement of edX's trademarks clear.${footer['copyright']} % if icp_license_info.get('icp_license'):