Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 9c80396

Browse files
committed
DEV: Re-introduce validator
1 parent 4dffd0b commit 9c80396

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

config/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ discourse_ai:
374374

375375
ai_spam_detection_enabled:
376376
default: false
377+
validator: "DiscourseAi::Configuration::SpamDetectionValidator"
377378
ai_spam_detection_user_id:
378379
default: ""
379380
hidden: true

lib/configuration/spam_detection_validator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ def initialize(opts = {})
1010
def valid_value?(val)
1111
return true if Rails.env.test?
1212
return true if AiModerationSetting.spam
13+
# only validate when enabling setting
14+
return true if val == "f"
1315

1416
false
1517
end

0 commit comments

Comments
 (0)