修复 devops无法激活项目的问题

This commit is contained in:
2022-05-27 10:48:20 +08:00
parent bd16ca476d
commit a6e50d2a25
2 changed files with 7 additions and 7 deletions

View File

@@ -40,9 +40,9 @@ class Ci::ProjectsController < Ci::BaseController
begin
ActiveRecord::Base.transaction do
if @repo
@repo.destroy! if @repo&.repo_user_id == 0
return render_error('该项目已经激活') if @repo.repo_active?
@repo.activate!(@project)
return render_ok
else
@repo = Ci::Repo.auto_create!(@ci_user, @project)
@ci_user.update_column(:user_syncing, false)