修改错误

This commit is contained in:
sylor_huang@126.com 2020-03-13 18:12:06 +08:00
parent 3d6155c3b2
commit 0771b2783c
1 changed files with 30 additions and 27 deletions

View File

@ -62,6 +62,8 @@ class SyncForgeJob < ApplicationJob
owner_params = owner_params&.except!(*keys_to_delete)
user_password = random_password
new_user = []
if owner_params.present?
if User.exists?(login: owner_params["login"])
new_user = User.find_by(login: owner_params["login"])
else
@ -87,13 +89,14 @@ class SyncForgeJob < ApplicationJob
if new_user.save!
if owner_extension_params.present?
owner_extension_params = owner_extension_params["user_extensions"] if old_version_source.include?(platform) #trustie上需要
owner_extension_params = owner_extension_params&.except!(*keys_other_delete).merge(user_id: new_user.id)
UserExtension.create!(owner_extension_params)
end
end
end
Rails.logger.info("#######______sync_user_end__########")
end
new_user
end