From d99c335dabfc57368a362e72cc0d281d3b3e6a95 Mon Sep 17 00:00:00 2001 From: Keegan George Date: Wed, 28 May 2025 10:12:21 -0700 Subject: [PATCH] DEV: Ensure enabling/disabling spam is set and logged (#1378) Since we enable/disable `ai_spam_detection_enabled` setting in a custom Spam tab UI in AI, we want to ensure we retain the setting and logging features. To preserve that, we want to update the controller to use `SiteSetting.set_and_log` instead of setting the value directly. --- app/controllers/discourse_ai/admin/ai_spam_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/discourse_ai/admin/ai_spam_controller.rb b/app/controllers/discourse_ai/admin/ai_spam_controller.rb index 6676ab5c..52ef6f4b 100644 --- a/app/controllers/discourse_ai/admin/ai_spam_controller.rb +++ b/app/controllers/discourse_ai/admin/ai_spam_controller.rb @@ -50,7 +50,7 @@ module DiscourseAi ) end - SiteSetting.ai_spam_detection_enabled = is_enabled + SiteSetting.set_and_log("ai_spam_detection_enabled", is_enabled, current_user) end render json: AiSpamSerializer.new(spam_config, root: false)