From a93bf186c507513d1a15fe0e5832a6894eceead7 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Thu, 28 Dec 2017 14:51:43 +0100 Subject: [PATCH] FIX: validation of website failed in base importer --- script/import_scripts/base.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/import_scripts/base.rb b/script/import_scripts/base.rb index 67c6ede4c73..4d177156b40 100644 --- a/script/import_scripts/base.rb +++ b/script/import_scripts/base.rb @@ -319,8 +319,12 @@ class ImportScripts::Base User.transaction do u.save! if bio_raw.present? || website.present? || location.present? + if website.present? + u.user_profile.website = website + u.user_profile.website = nil unless u.user_profile.valid? + end + u.user_profile.bio_raw = bio_raw[0..2999] if bio_raw.present? - u.user_profile.website = website unless website.blank? || website !~ UserProfile::WEBSITE_REGEXP u.user_profile.location = location if location.present? u.user_profile.save! end