2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

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