Merge pull request #3127 from riking/self-delete-locale
FIX: 🈂️ Use site-wide locale for deletion stubs
This commit is contained in:
commit
ab4eb353af
|
@ -97,11 +97,13 @@ class PostDestroyer
|
|||
|
||||
# When a user 'deletes' their own post. We just change the text.
|
||||
def mark_for_deletion
|
||||
Post.transaction do
|
||||
@post.revise(@user, { raw: I18n.t('js.post.deleted_by_author', count: SiteSetting.delete_removed_posts_after) }, force_new_version: true)
|
||||
@post.update_column(:user_deleted, true)
|
||||
@post.update_flagged_posts_count
|
||||
@post.topic_links.each(&:destroy)
|
||||
I18n.with_locale(SiteSetting.default_locale) do
|
||||
Post.transaction do
|
||||
@post.revise(@user, { raw: I18n.t('js.post.deleted_by_author', count: SiteSetting.delete_removed_posts_after) }, force_new_version: true)
|
||||
@post.update_column(:user_deleted, true)
|
||||
@post.update_flagged_posts_count
|
||||
@post.topic_links.each(&:destroy)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue