fixed 补偿users.gitea_uid不存在的用户,error message

This commit is contained in:
xxqfamous 2023-05-22 14:20:47 +08:00
parent 9f4d9aa5db
commit 9449bd6eb9
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ namespace :repair_gitea_user do
user.save!
success_count = success_count + 1
else
if interactor.result['message'].present? && interactor.result['message'].to_s.include?("user already exists")
if interactor.result[:message].present? && interactor.result[:message].to_s.include?("user already exists")
uid = ActiveRecord::Base.connection.query_value("SELECT id FROM forgegitea.`user` WHERE forgegitea.`user`.name='#{user.login}' and forgegitea.`user`.email='#{user.mail}'")
if uid.present?
result = Gitea::User::GenerateTokenService.call(user.login, "abc12345678" )