FIX: base importer should warn when there's an error in the user_profile

This commit is contained in:
Régis Hanol 2015-04-17 16:31:46 +02:00
parent 961c888087
commit 78f5fe190a
1 changed files with 4 additions and 2 deletions

View File

@ -249,12 +249,14 @@ class ImportScripts::Base
elsif u[:email].present?
new_user = create_user(u, import_id)
if new_user.valid?
if new_user.valid? && new_user.user_profile.valid?
@existing_users[import_id.to_s] = new_user.id
users_created += 1
else
@failed_users << u
puts "Failed to create user id: #{import_id}, username: #{new_user.username}, email: #{new_user.email}: #{new_user.errors.full_messages}"
puts "Failed to create user id: #{import_id}, username: #{new_user.username}, email: #{new_user.email}"
puts "user errors: #{new_user.errors.full_messages}"
puts "user_profile errors: #{new_user.user_profiler.errors.full_messages}"
end
else
@failed_users << u