diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index df40eb378..b8165e56b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -691,9 +691,22 @@ class ProjectsController < ApplicationController redirect_to settings_project_url(@project, :tab => 'modules') end + GITLABTYPE = "Repository::Gitlab" def archive if request.post? - unless @project.archive + if @project.archive + # 删除版本库信息 + begin + g = Gitlab.client + g.delete_project(@project.gpid) + rescue Exception => e + puts e + end + # 删除Trustie班额本库记录 + repoisitory = Repository.where(:project_id => @project.id, :type => GITLABTYPE).first + repoisitory.delete + @project.update_column(:gpid, nil) + else flash[:error] = l(:error_can_not_archive_project) end end diff --git a/app/views/projects/settings/_new_edit.html.erb b/app/views/projects/settings/_new_edit.html.erb index 3a2408504..a2ccbd967 100644 --- a/app/views/projects/settings/_new_edit.html.erb +++ b/app/views/projects/settings/_new_edit.html.erb @@ -41,7 +41,7 @@