auth_user.username = safe_convert(atg_user.login, 40) auth_user.email = '' auth_user.password = '******' % ('md5', '', atg_user.password) auth_user.save() except Exception, e: log.exception('Error creating auth_user for %s' % atg_user.login) return p = Profile() p.user = auth_user p.full_name = '%s %s %s' % (safe_convert(atg_user.first_name, 40, ''), safe_convert(atg_user.middle_name, 40, ''), safe_convert(atg_user.last_name, 40, '')) p.full_name = re.sub(' +', ' ', p.full_name) # Remove multiple spaces p.atg_login = safe_convert(atg_user.login, 40) p.atg_password = safe_convert(atg_user.password, 35) p.save() # Save the profile map_entry = AtgUserMigrationMap(profile = p, atg_login = safe_convert(atg_user.login, 40)) map_entry.save() if phone: phone.user = p phone.save() if email: email.user = p email.save() return p
auth_user.username = safe_convert(atg_user.login, 40) auth_user.email = '' auth_user.password = '******' % ('md5', '', atg_user.password) auth_user.save() except Exception, e: log.exception('Error creating auth_user for %s' % atg_user.login) return p = Profile() p.user = auth_user p.full_name = '%s %s %s' % (safe_convert(atg_user.first_name, 40, ''), safe_convert(atg_user.middle_name, 40, ''), safe_convert(atg_user.last_name, 40, '')) p.full_name = re.sub(' +', ' ', p.full_name) # Remove multiple spaces p.atg_login = safe_convert(atg_user.login, 40) p.atg_password = safe_convert(atg_user.password, 35) p.save() # Save the profile map_entry = AtgUserMigrationMap(profile=p, atg_login=safe_convert(atg_user.login, 40)) map_entry.save() if phone: phone.user = p phone.save() if email: email.user = p email.save() return p