Merge pull request #3127 from riking/self-delete-locale

FIX: 🈂️ Use site-wide locale for deletion stubs
This commit is contained in:
Robin Ward 2015-01-26 11:04:04 -05:00
commit ab4eb353af
1 changed files with 7 additions and 5 deletions

View File

@ -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