mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-07-01 20:12:15 +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:
|
ai_spam_detection_enabled:
|
||||||
default: false
|
default: false
|
||||||
|
validator: "DiscourseAi::Configuration::SpamDetectionValidator"
|
||||||
ai_spam_detection_user_id:
|
ai_spam_detection_user_id:
|
||||||
default: ""
|
default: ""
|
||||||
hidden: true
|
hidden: true
|
||||||
|
@ -10,6 +10,8 @@ module DiscourseAi
|
|||||||
def valid_value?(val)
|
def valid_value?(val)
|
||||||
return true if Rails.env.test?
|
return true if Rails.env.test?
|
||||||
return true if AiModerationSetting.spam
|
return true if AiModerationSetting.spam
|
||||||
|
# only validate when enabling setting
|
||||||
|
return true if val == "f"
|
||||||
|
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user