From 78f5fe190aebe4be12d40b853f2e0fc66914399a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Fri, 17 Apr 2015 16:31:46 +0200 Subject: [PATCH] FIX: base importer should warn when there's an error in the user_profile --- script/import_scripts/base.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index 201117721a9..a095ae419a6 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -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