FIX: recover post by a non-staff user fails because the post is not unique. Uniqueness check shouldn't happen when recovering a deleted post.

This commit is contained in:
Neil Lalonde
2013-09-06 11:50:05 -04:00
parent b0573c5f8f
commit eae7e75611
5 changed files with 57 additions and 21 deletions

View File

@ -58,6 +58,7 @@ class Validators::PostValidator < ActiveModel::Validator
# Stop us from posting the same thing too quickly
def unique_post_validator(post)
return if SiteSetting.unique_posts_mins == 0
return if post.skip_unique_check
return if post.acting_user.admin? || post.acting_user.moderator?
# If the post is empty, default to the validates_presence_of