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)}"}