Merge pull request #26002 from edx/saad/TNL-7877

[TNL-7877] - Cleanup branding app.
This commit is contained in:
Saad Yousaf
2021-01-08 13:58:49 +05:00
committed by GitHub
2 changed files with 0 additions and 62 deletions

View File

@@ -26,7 +26,6 @@ from six.moves.urllib.parse import urljoin
from lms.djangoapps.branding.models import BrandingApiConfig
from common.djangoapps.edxmako.shortcuts import marketing_link
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
from .toggles import app_logs_enabled
log = logging.getLogger("edx.footer")
EMPTY_URL = '#'
@@ -460,16 +459,6 @@ def _footer_logo_img(is_secure):
settings.FOOTER_ORGANIZATION_IMAGE
)
if app_logs_enabled():
log.info(
("[Branding][footer_logo_img]: site_config:%s, footer_org_img:%s,"
"brand_url:%s, default:%s"),
footer_url_from_site_config,
settings.FOOTER_ORGANIZATION_IMAGE,
brand_footer_logo_url,
default_local_path
)
# `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
@@ -594,16 +583,6 @@ def get_logo_url(is_secure=True):
logo_url_from_site_config = configuration_helpers.get_value('logo_image_url')
university = configuration_helpers.get_value('university')
if app_logs_enabled():
log.info(
("[Branding][get_logo_url]: site_config:%s, university:%s, "
"brand_url:%s, default:%s"),
logo_url_from_site_config,
university,
brand_logo_url,
default_local_path
)
if logo_url_from_site_config:
return _absolute_url_staticfile(is_secure=is_secure, name=logo_url_from_site_config)
@@ -629,15 +608,6 @@ def get_favicon_url():
default_local_path = getattr(settings, 'FAVICON_PATH', 'images/favicon.ico')
favicon_url_from_site_config = configuration_helpers.get_value('favicon_path')
if app_logs_enabled():
log.info(
("[Branding][get_favicon_url]: site_config:%s, brand_url:%s "
"default:%s"),
favicon_url_from_site_config,
brand_favicon_url,
default_local_path,
)
if favicon_url_from_site_config:
return staticfiles_storage.url(favicon_url_from_site_config)

View File

@@ -1,32 +0,0 @@
"""
Waffle flags for Branding app.
"""
from edx_toggles.toggles import WaffleFlag, WaffleFlagNamespace
WAFFLE_FLAG_NAMESPACE = WaffleFlagNamespace(name='branding')
# Waffle flag for testing purpose only. When setting the flag in prod,
# make sure to have the following settings. Use "dwft_branding.enable_branding_logs=1"
# in the browser query to enable the flag.
# .. toggle_name: branding.enable_branding_logs
# .. toggle_everyone: unknown
# .. toggle_testing: True
# .. toggle_implementation: WaffleFlag
# .. toggle_default: False
# .. toggle_description: Supports testing for re-branding work.
# .. toggle_category: branding
# .. toggle_use_cases: open_edx
# .. toggle_creation_date: 2020-11-22
# .. toggle_target_removal_date: 2021-01-01
# .. toggle_warnings: n/a
# .. toggle_tickets: TNL-7695
# .. toggle_status: supported
ENABLE_BRANDING_LOGS = WaffleFlag(
waffle_namespace=WAFFLE_FLAG_NAMESPACE,
flag_name='enable_branding_logs',
)
def app_logs_enabled():
"""Check if app logging is enabled. """
return ENABLE_BRANDING_LOGS.is_enabled()