diff --git a/lib/post_creator.rb b/lib/post_creator.rb index 18177162f2e..824be4e9856 100644 --- a/lib/post_creator.rb +++ b/lib/post_creator.rb @@ -132,9 +132,9 @@ class PostCreator # We need to enqueue jobs after the transaction. Otherwise they might begin before the data has # been comitted. - Jobs.enqueue(:feature_topic_users, topic_id: topic.id) if topic.present? - - post.trigger_post_process + topic_id = @opts[:topic_id] || topic.try(:id) + Jobs.enqueue(:feature_topic_users, topic_id: topic.id) if topic_id.present? + post.trigger_post_process if post.present? post end