FIX: log a staff action + send a private message when disabling the 'download_remote_images_to_local' site setting

This commit is contained in:
Régis Hanol
2014-09-23 19:11:14 +02:00
parent dc789502f9
commit 5681338b08
3 changed files with 9 additions and 2 deletions

View File

@@ -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