mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Return actual errors if PostCreator fails (#7096)
This commit is contained in:
committed by
Gerhard Schlager
parent
b1035cc691
commit
655a08dbbd
@@ -563,7 +563,7 @@ class ImportScripts::Base
|
|||||||
post_creator = PostCreator.new(user, opts)
|
post_creator = PostCreator.new(user, opts)
|
||||||
post = post_creator.create
|
post = post_creator.create
|
||||||
post_create_action.try(:call, post) if post
|
post_create_action.try(:call, post) if post
|
||||||
post ? post : post_creator.errors.full_messages
|
if !post || post_creator.errors&.length > 0 ? post : post_creator.errors.full_messages
|
||||||
end
|
end
|
||||||
|
|
||||||
def create_upload(user_id, path, source_filename)
|
def create_upload(user_id, path, source_filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user