mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Can't recover a post when its user has been deleted.
https://meta.discourse.org/t/moving-posts-to-new-topic/58436
This commit is contained in:
@@ -149,7 +149,11 @@ module PostGuardian
|
||||
|
||||
# Recovery Method
|
||||
def can_recover_post?(post)
|
||||
is_staff? || (is_my_own?(post) && post.user_deleted && !post.deleted_at)
|
||||
if is_staff?
|
||||
post.deleted_at && post.user
|
||||
else
|
||||
is_my_own?(post) && post.user_deleted && !post.deleted_at
|
||||
end
|
||||
end
|
||||
|
||||
def can_delete_post_action?(post_action)
|
||||
|
||||
@@ -52,7 +52,7 @@ module TopicGuardian
|
||||
|
||||
# Recovery Method
|
||||
def can_recover_topic?(topic)
|
||||
is_staff?
|
||||
topic && topic.deleted_at && topic.user && is_staff?
|
||||
end
|
||||
|
||||
def can_delete_topic?(topic)
|
||||
|
||||
Reference in New Issue
Block a user