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.
This commit is contained in:
Keegan George 2025-05-28 10:12:21 -07:00 committed by GitHub
parent 01e29ca5d8
commit d99c335dab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

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