mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Blocked watched words should apply to staff (#7547)
Having different behavior for staff and regular users can make it confusing for admins to understand how their configuration changes affect regular users
This commit is contained in:
@ -60,7 +60,7 @@ class Validators::PostValidator < ActiveModel::Validator
|
||||
end
|
||||
|
||||
def watched_words(post)
|
||||
if !post.acting_user&.staff? && !post.acting_user&.staged && matches = WordWatcher.new(post.raw).should_block?
|
||||
if !post.acting_user&.staged && matches = WordWatcher.new(post.raw).should_block?
|
||||
post.errors.add(:base, I18n.t('contains_blocked_words', word: matches[0]))
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user