FIX: 🈂️ Use site-wide locale for deletion stubs

This commit is contained in:
riking 2015-01-24 18:19:57 -08:00
parent 7d07ad4aa4
commit 0debca4278
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