From c76cb671add9e588e4dcea69d343687ae98495fa Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 5 Aug 2015 10:49:59 +1000 Subject: [PATCH] unblock early. --- app/models/queued_post.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/queued_post.rb b/app/models/queued_post.rb index 6ca1a599b4a..6bbff2a0530 100644 --- a/app/models/queued_post.rb +++ b/app/models/queued_post.rb @@ -64,6 +64,10 @@ class QueuedPost < ActiveRecord::Base QueuedPost.transaction do change_to!(:approved, approved_by) + if user.blocked? + user.update_columns(blocked: false) + end + creator = PostCreator.new(user, create_options.merge(skip_validations: true)) created_post = creator.create @@ -71,9 +75,6 @@ class QueuedPost < ActiveRecord::Base raise StandardError, "Failed to create post #{raw[0..100]} #{creator.errors}" end - if user.blocked? - user.update_columns(blocked: false) - end end DiscourseEvent.trigger(:approved_post, self)