Insufficient checking of PostCreator in importer base

Hi,

It seems that if (for example) you mistakenly try and add target_usernames to a post with user_ids rather than usernames, create_post in scripts/import_scripts/base.rb won’t return an error.

This is because it returns: post ? post : post_creator.errors.full_messages. However, post has already been initialised as a Post type on line 564. Checking for the post_creator errors instead returns the correct behaviour.

I’ll submit a pull request for this :slight_smile:

4 Likes

Sure, please do. :hugs:

1 Like

https://github.com/discourse/discourse/pull/7096

5 Likes

The PR has been merged.

5 Likes

This topic was automatically closed after 42 hours. New replies are no longer allowed.