unblock early.

This commit is contained in:
Sam 2015-08-05 10:49:59 +10:00
parent 34122e06df
commit c76cb671ad

View File

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