Fix a case when a staff user views a topic with a deleted post by a nuked user; might be a temporary solution until we decide what to do with nuked records

This commit is contained in:
Neil Lalonde
2013-07-10 16:52:34 -04:00
parent 91dc0b9ef1
commit 8814f9ed05
8 changed files with 17 additions and 2 deletions

View File

@ -27,7 +27,7 @@ class TopicView
@limit = options[:limit] || SiteSetting.posts_per_page;
@filtered_posts = @topic.posts
@filtered_posts = @filtered_posts.with_deleted if user.try(:staff?)
@filtered_posts = @filtered_posts.with_deleted.without_nuked_users if user.try(:staff?)
@filtered_posts = @filtered_posts.best_of if options[:filter] == 'best_of'
@filtered_posts = @filtered_posts.where('posts.post_type <> ?', Post.types[:moderator_action]) if options[:best].present?