From f3d6244fee2c66eef3ba451a4f26d307ded451cd Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Fri, 11 Sep 2020 09:55:21 +0800 Subject: [PATCH] FIX ci certification bug --- app/controllers/ci/cloud_accounts_controller.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/ci/cloud_accounts_controller.rb b/app/controllers/ci/cloud_accounts_controller.rb index 8efe6c959..25cd89a4a 100644 --- a/app/controllers/ci/cloud_accounts_controller.rb +++ b/app/controllers/ci/cloud_accounts_controller.rb @@ -23,7 +23,7 @@ class Ci::CloudAccountsController < Ci::BaseController end def activate - return render_error('请先在指定地址做用户认证') unless @user.ci_certification? + return render_error('请先在指定地址做用户认证') unless current_user.ci_certification? return render_error('该项目已经激活') if @repo && @repo.repo_active? begin @@ -31,15 +31,15 @@ class Ci::CloudAccountsController < Ci::BaseController ActiveRecord::Base.transaction do if @repo return render_error('该项目已经激活') if @repo.repo_active? - @repo.activate!(@user.user_id) + @repo.activate!(current_user.user_id) else - @repo = Ci::Repo.auto_create!(@uesr, @project) + @repo = Ci::Repo.auto_create!(current_user, @project) @user.update_column(:user_syncing, false) end - result = bind_hook!(@user, @cloud_account, @repo) + result = bind_hook!(current_user, @cloud_account, @repo) @project.update_columns(open_devops: true, gitea_webhook_id: result['id']) - @cloud_account.update_column(:ci_user_id, @user.user_id) + @cloud_account.update_column(:ci_user_id, current_user.user_id) end render_ok rescue Exception => ex