mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
FIX: if post creation fails, raise an exception
This commit is contained in:
parent
2b2ae4bfe7
commit
34122e06df
1 changed files with 4 additions and 0 deletions
|
@ -67,6 +67,10 @@ class QueuedPost < ActiveRecord::Base
|
|||
creator = PostCreator.new(user, create_options.merge(skip_validations: true))
|
||||
created_post = creator.create
|
||||
|
||||
unless created_post && creator.errors.blank?
|
||||
raise StandardError, "Failed to create post #{raw[0..100]} #{creator.errors}"
|
||||
end
|
||||
|
||||
if user.blocked?
|
||||
user.update_columns(blocked: false)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue