Skip to content
Snippets Groups Projects
Unverified Commit c048b892 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix when author is missing on import

parent 7184d068
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,7 @@ class Communication::Website::Imported::Post < ApplicationRecord
post.published = true
imported_author = website.authors.where(identifier: author).first
post.author = imported_author.author if imported_author.author
post.author = imported_author.author if imported_author&.author.present?
imported_categories = website.categories.where(identifier: categories)
imported_categories.each do |imported_category|
post.categories << imported_category.category unless post.categories.pluck(:id).include?(imported_category.category_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment