refactor: change placeholder variable_name + url and add placeholder image
This commit is contained in:
@@ -2914,8 +2914,8 @@ SOCIAL_MEDIA_LOGO_URLS = {
|
||||
'facebook': 'http://email-media.s3.amazonaws.com/edX/2021/social_1_fb.png',
|
||||
}
|
||||
|
||||
# .. setting_name: DEFAULT_ORG_LOGO_URL
|
||||
# .. setting_default: organization_logos/_placeholder.png # FIXME: change to correct placeholder
|
||||
# .. setting_description: The default logo URL for organizations that do not have a logo set.
|
||||
# .. setting_warning: This URL is used as a placeholder for organizations that do not have a logo set.
|
||||
DEFAULT_ORG_LOGO_URL = 'organization_logos/_placeholder.png' # FIXME: change to correct placeholder
|
||||
# .. setting_name: DEFAULT_ORG_LOGO_PATH
|
||||
# .. setting_default: 'images/org_placeholder.png'
|
||||
# .. setting_description: The default logo path for organizations that do not have a logo set.
|
||||
# .. setting_warning: This path is used as a placeholder for organizations that do not have a logo set.
|
||||
DEFAULT_ORG_LOGO_PATH = 'images/org_placeholder.png'
|
||||
|
||||
BIN
lms/static/images/org_placeholder.png
Normal file
BIN
lms/static/images/org_placeholder.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.3 KiB |
@@ -41,7 +41,7 @@ def course_image_url(course, image_key='course_image'):
|
||||
|
||||
def course_organization_image_url(course):
|
||||
"""Return the course organization image URL or the default image URL."""
|
||||
default_logo_url = settings.MEDIA_URL + settings.DEFAULT_ORG_LOGO_URL
|
||||
default_logo_url = settings.STATIC_URL + settings.DEFAULT_ORG_LOGO_PATH
|
||||
|
||||
org = Organization.objects.filter(short_name=course.id.org).first()
|
||||
return org.logo.url if org and org.logo else default_logo_url
|
||||
|
||||
Reference in New Issue
Block a user