FIX: Allow users to opt-out of using the site's small logo as the system user avatar. (#11744)

This commit is contained in:
Roman Rizzi 2021-01-18 14:09:07 -03:00 committed by GitHub
parent be1b75187e
commit 7ac9a4d2ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -868,7 +868,10 @@ class User < ActiveRecord::Base
end
def avatar_template
if id == Discourse::SYSTEM_USER_ID && SiteSetting.logo_small
use_small_logo = id == Discourse::SYSTEM_USER_ID &&
SiteSetting.logo_small && SiteSetting.use_site_small_logo_as_system_avatar
if use_small_logo
UrlHelper.absolute(SiteSetting.logo_small.url)
else
self.class.avatar_template(username, uploaded_avatar_id)

View File

@ -1776,6 +1776,7 @@ en:
external_system_avatars_enabled: "Use external system avatars service."
external_system_avatars_url: "URL of the external system avatars service. Allowed substitutions are {username} {first_letter} {color} {size}"
use_site_small_logo_as_system_avatar: "Use the site's small logo instead of the system user's avatar. Requires the logo to be present."
restrict_letter_avatar_colors: "A list of 6-digit hexadecimal color values to be used for letter avatar background."
selectable_avatars_enabled: "Force users to choose an avatar from the list."

View File

@ -2083,6 +2083,9 @@ uncategorized:
hidden: true
default: true
use_site_small_logo_as_system_avatar:
default: true
disable_system_edit_notifications: true
notification_consolidation_threshold: