mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-30 19:42:17 +00:00
DEV: Re-introduce validator
This commit is contained in:
parent
4dffd0b2c5
commit
9c80396942
@ -374,6 +374,7 @@ discourse_ai:
|
||||
|
||||
ai_spam_detection_enabled:
|
||||
default: false
|
||||
validator: "DiscourseAi::Configuration::SpamDetectionValidator"
|
||||
ai_spam_detection_user_id:
|
||||
default: ""
|
||||
hidden: true
|
||||
|
@ -10,6 +10,8 @@ module DiscourseAi
|
||||
def valid_value?(val)
|
||||
return true if Rails.env.test?
|
||||
return true if AiModerationSetting.spam
|
||||
# only validate when enabling setting
|
||||
return true if val == "f"
|
||||
|
||||
false
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user