mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +08:00
FIX: Recover post tutorial does not work when SiteSetting.delete_removed_posts_after
is 0.
This commit is contained in:
@ -144,7 +144,23 @@ module DiscourseNarrativeBot
|
||||
})
|
||||
|
||||
set_state_data(:post_id, post.id)
|
||||
PostDestroyer.new(@user, post, skip_bot: true).destroy
|
||||
|
||||
opts = { skip_bot: true }
|
||||
|
||||
if SiteSetting.delete_removed_posts_after < 1
|
||||
opts[:delete_removed_posts_after] = 1
|
||||
|
||||
# Flag it and defer so the stub doesn't get destroyed
|
||||
flag = PostAction.create!(
|
||||
user: self.discobot_user,
|
||||
post: post, post_action_type_id:
|
||||
PostActionType.types[:off_topic]
|
||||
)
|
||||
|
||||
PostAction.defer_flags!(post, self.discobot_user)
|
||||
end
|
||||
|
||||
PostDestroyer.new(@user, post, opts).destroy
|
||||
end
|
||||
|
||||
def start_advanced_track
|
||||
|
Reference in New Issue
Block a user