mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 04:48:17 +08:00
FIX: Recovered posts with no user will be taken over by system user (#8834)
This commit is contained in:
@ -91,6 +91,7 @@ class PostDestroyer
|
||||
user_recovered
|
||||
end
|
||||
topic = Topic.with_deleted.find @post.topic_id
|
||||
topic.update_column(:user_id, Discourse::SYSTEM_USER_ID) if !topic.user_id
|
||||
topic.recover!(@user) if @post.is_first_post?
|
||||
topic.update_statistics
|
||||
UserActionManager.post_created(@post)
|
||||
@ -103,6 +104,7 @@ class PostDestroyer
|
||||
end
|
||||
|
||||
def staff_recovered
|
||||
@post.update_column(:user_id, Discourse::SYSTEM_USER_ID) if !@post.user_id
|
||||
@post.recover!
|
||||
|
||||
mark_topic_changed
|
||||
|
Reference in New Issue
Block a user