Skip to content

A platform for community discussion. Free, open, simple.

FEATURE: log admin's choice to backfill when updating a default site (#36296)

Régis Hanolc519798c35e8
diff --git a/app/services/site_setting/update.rb b/app/services/site_setting/update.rb
index 45827ca8b82..91a0a05697b 100644
--- a/app/services/site_setting/update.rb
+++ b/app/services/site_setting/update.rb
@@ -80,11 +80,19 @@ class SiteSetting::Update
def save(params:, options:, guardian:)
params.settings.each do |setting|
+ detailed_message =
+ if default_user_preference?(setting)
+ value =
+ setting.backfill ? I18n.t("csv_export.boolean_yes") : I18n.t("csv_export.boolean_no")
+ I18n.t("staff_action_logs.site_setting.update_existing_users", value:)
+ end
+
setting.change =
SiteSetting.set_and_log(
options.overridden_setting_names[setting.name] || setting.name,
setting.value,
guardian.user,
+ detailed_message,
)
end
end
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 202ff24064d..cb90f5a27dd 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -5603,6 +5603,8 @@ en:
json_too_long: "Values not logged because they exceed the column length limits"
not_found: "not found"
unknown: "unknown"
+ site_setting:
+ update_existing_users: "update existing users? %{value}"
user_merged: "%{username} was merged into this account"
user_delete_self: "Deleted by self from %{url}"
webhook_deactivation_reason: "Your webhook has been automatically deactivated. We received multiple '%{status}' HTTP status failure responses."