Merge branch 'dev-homepage-revision' into 'develop'

修复版本库不存在时,管理员删除项目出错的bug

修复版本库不存在时,管理员删除项目出错的bug

See merge request !186
This commit is contained in:
陈晓婷 2019-10-11 13:39:08 +08:00
commit f3aa5c1718
1 changed files with 15 additions and 16 deletions

View File

@ -1124,7 +1124,7 @@ class ProjectsController < ApplicationController
g.delete_project(@project.gpid)
# 删除Trustie版本库记录
repoisitory = Repository.where(:project_id => @project.id, :type => GITLABTYPE).first
repoisitory.delete
repoisitory.delete unless repository.blank?
@project.update_column(:gpid, nil)
@project.update_column(:forked_from_project_id, nil)
@project_to_destroy = @project
@ -1332,4 +1332,3 @@ class ProjectsController < ApplicationController
true
end
end