mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Merge pull request #2780 from riking/post-finder-404
FIX: Unknown /posts/id.json should 404
This commit is contained in:
commit
16c61f1eab
1 changed files with 1 additions and 0 deletions
|
@ -382,6 +382,7 @@ class PostsController < ApplicationController
|
||||||
# Include deleted posts if the user is staff
|
# Include deleted posts if the user is staff
|
||||||
finder = finder.with_deleted if current_user.try(:staff?)
|
finder = finder.with_deleted if current_user.try(:staff?)
|
||||||
post = finder.first
|
post = finder.first
|
||||||
|
raise Discourse::NotFound unless post
|
||||||
# load deleted topic
|
# load deleted topic
|
||||||
post.topic = Topic.with_deleted.find(post.topic_id) if current_user.try(:staff?)
|
post.topic = Topic.with_deleted.find(post.topic_id) if current_user.try(:staff?)
|
||||||
guardian.ensure_can_see!(post)
|
guardian.ensure_can_see!(post)
|
||||||
|
|
Loading…
Reference in a new issue