FIX: Give 403 for deleted topics, +lots of tests

This commit is contained in:
Kane York
2015-09-11 08:29:44 -07:00
parent 18d7c1c75d
commit 460243d7a3
3 changed files with 122 additions and 3 deletions
+2 -2
View File
@@ -355,8 +355,8 @@ class TopicView
end
def find_topic(topic_id)
finder = Topic.where(id: topic_id).includes(:category)
finder = finder.with_deleted if @guardian.can_see_deleted_topics?
# with_deleted covered in #check_and_raise_exceptions
finder = Topic.with_deleted.where(id: topic_id).includes(:category)
finder.first
end