版本库不能创建问题

This commit is contained in:
huang 2018-09-30 17:31:52 +08:00
parent e31c35c6a0
commit e50207e4e8
1 changed files with 7 additions and 7 deletions

View File

@ -363,7 +363,7 @@ update
@repository.identifier = @repository.identifier.downcase
@repository.url = @repository.identifier
ActiveRecord::Base.transaction do
begin
# begin
if request.post? && @repository.save!
s = Trustie::Gitlab::Sync.new
s.create_project(@project, @repository)
@ -372,12 +372,12 @@ update
else
redirect_to settings_project_url(@project, :tab => 'repositories',:repository_error_message=>@repository.errors.full_messages)
end
rescue Exception => e
logger.info("create repository #{e.message}")
@repo_error= "666"
redirect_to settings_project_url(@project, :tab => 'repositories', :create_error => "版本库创建失败,用户名或版本库名中不允许包含特殊字符")
raise ActiveRecord::Rollback
end
# rescue Exception => e
# logger.info("create repository #{e.message}")
# @repo_error= "666"
# redirect_to settings_project_url(@project, :tab => 'repositories', :create_error => "版本库创建失败,用户名或版本库名中不允许包含特殊字符")
# raise ActiveRecord::Rollback
# end
end
end
end