From 234a8d7f7db3ef47cc00dff6590ced0db5eaaa27 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Sep 2017 15:53:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=89=88=E6=9C=AC=E5=BA=93?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E6=9B=B4=E6=96=B0=E4=B8=8D=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/shixuns_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index f75b39235..9f16575b8 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -395,7 +395,8 @@ class ShixunsController < ApplicationController gshixun = g.fork(@shixun.gpid, User.current.gid) if !gshixun.try(:id).blank? myshixun.update_column(:gpid, gshixun.id) if myshixun.try(:gpid).blank? # 为了防止多次fork - Repository.create!(:myshixun_id => myshixun.id, :identifier => gshixun.name,:project_id => -1, :shixun_id => -2, :type => "Repository::Gitlab") + rep = Repository.create!(:myshixun_id => myshixun.id, :identifier => gshixun.name,:project_id => -1, :shixun_id => -2) + rep.update_column(:type, "Repository::Gitlab") rep_url = Base64.urlsafe_encode64(git_shixun_url_ip @shixun, "educoder") # 注意:educoder为默认给实训创建版本库的用户,如果换成别的用户,名字要相应的修改 uri = "#{shixun_tomcat}/bridge/game/openGameInstance" params = {tpiID: "#{myshixun.id}", tpmID: "#{@shixun.id}", instanceGitURL:rep_url, operationEnvironment:"#{@shixun.try(:language)}"}