Merge pull request #4155 from mcwumbly/quandora-post-author

Fix issue setting post author during import from Quandora
This commit is contained in:
Régis Hanol 2016-04-09 13:54:08 +02:00
commit 09bbfcb77d

View File

@ -56,9 +56,9 @@ class ImportScripts::Quandora < ImportScripts::Base
post = create_post(topic, topic[:id]) post = create_post(topic, topic[:id])
unless created_topic.is_a?(Post) unless post.is_a?(Post)
puts "Error creating topic #{topic[:id]}. Skipping." puts "Error creating topic #{topic[:id]}. Skipping."
puts created_topic.inspect puts post.inspect
end end
end end
@ -76,7 +76,7 @@ class ImportScripts::Quandora < ImportScripts::Base
return # already imported return # already imported
end end
post[:topic_id] = topic_id post[:topic_id] = topic_id
post[:user_id] = user_id_from_imported_user_id(post[:author_id]) post[:user_id] = user_id_from_imported_user_id(post[:author_id]) || -1
new_post = create_post post, post[:id] new_post = create_post post, post[:id]
unless new_post.is_a?(Post) unless new_post.is_a?(Post)
puts "Error creating post #{post[:id]}. Skipping." puts "Error creating post #{post[:id]}. Skipping."