FIX: Show warning only if new value is different (#12893)

A warning is logged when a shadowed site setting is being changed. This
should not be the case when the new value is the same as the old one.
This commit is contained in:
Dan Ungureanu 2021-05-03 10:25:02 +03:00 committed by GitHub
parent 286b6916af
commit 3ff9dbb15c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -484,7 +484,7 @@ module SiteSettingExtension
end
define_singleton_method "#{clean_name}=" do |val|
Rails.logger.warn("An attempt was to change #{clean_name} SiteSetting to #{val} however it is shadowed so this will be ignored!")
Rails.logger.warn("An attempt was to change #{clean_name} SiteSetting to #{val} however it is shadowed so this will be ignored!") if value != val
nil
end