mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: log a staff action + send a private message when disabling the 'download_remote_images_to_local' site setting
This commit is contained in:
@@ -245,7 +245,12 @@ class CookedPostProcessor
|
||||
def disable_if_low_on_disk_space
|
||||
if available_disk_space < SiteSetting.download_remote_images_threshold
|
||||
SiteSetting.download_remote_images_to_local = false
|
||||
SystemMessage.create(Discourse.site_contact_user, :download_remote_images_disabled)
|
||||
# log the site setting change
|
||||
reason = I18n.t("disable_remote_images_download_reason")
|
||||
staff_action_logger = StaffActionLogger.new(Discourse.system_user)
|
||||
staff_action_logger.log_site_setting_change("download_remote_images_to_local", true, false, { details: reason })
|
||||
# also send a private message to the site contact user
|
||||
SystemMessage.create_from_system_user(Discourse.site_contact_user, :download_remote_images_disabled)
|
||||
return true
|
||||
end
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user