FEATURE: Staff should be exempt from user mention limit

This commit is contained in:
Arpit Jalan
2016-02-01 21:07:49 +05:30
parent 49d1f88f6e
commit 99c4252ba6
2 changed files with 51 additions and 0 deletions

View File

@@ -54,6 +54,8 @@ class Validators::PostValidator < ActiveModel::Validator
# Ensure maximum amount of mentions in a post
def max_mention_validator(post)
return if post.acting_user.try(:staff?)
if acting_user_is_trusted?(post)
add_error_if_count_exceeded(post, :no_mentions_allowed, :too_many_mentions, post.raw_mentions.size, SiteSetting.max_mentions_per_post)
else