FIX: when uploading image newuser restrictions should not apply to staff

This commit is contained in:
Arpit Jalan
2018-04-05 09:51:03 +05:30
parent 0d6cfe45bf
commit 10759677db
2 changed files with 44 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class Validators::PostValidator < ActiveModel::Validator
# Ensure new users can not put too many images in a post
def max_images_validator(post)
return if post.acting_user.blank?
return if post.acting_user.blank? || post.acting_user&.staff?
if post.acting_user.trust_level < TrustLevel[SiteSetting.min_trust_to_post_images]
add_error_if_count_exceeded(