From 4dc7296b247cc2385cc3e9df73323b4a85b02123 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 19 Nov 2019 14:36:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fork=E5=AE=9E=E8=B7=B5=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E7=9A=84=E7=AB=A0=E8=8A=82=E6=95=B0=EF=BC=8C=E5=85=B3=E5=8D=A1?= =?UTF-8?q?=E6=95=B0=E5=92=8C=E5=AE=9E=E8=AE=AD=E7=9A=84=E5=85=B3=E5=8D=A1?= =?UTF-8?q?=E6=95=B0=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/subjects/copy_subject_service.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/services/subjects/copy_subject_service.rb b/app/services/subjects/copy_subject_service.rb index 5f8481cae..94157dc7b 100644 --- a/app/services/subjects/copy_subject_service.rb +++ b/app/services/subjects/copy_subject_service.rb @@ -5,7 +5,8 @@ class Subjects::CopySubjectService < ApplicationService @subject = subject @user = user @laboratory = laboratory - subject_params = subject.attributes.dup.except('id', 'copy_subject_id', 'user_id', 'homepage_show') + subject_params = subject.attributes.dup.except('id', 'copy_subject_id', 'user_id', 'homepage_show', + 'stages_count', 'shixuns_count', 'stage_shixuns_count') @to_subject = Subject.new(subject_params) end @@ -59,7 +60,7 @@ class Subjects::CopySubjectService < ApplicationService shixun = stage_shixun.shixun to_shixun = Shixun.new to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show', - 'use_scope', 'averge_star', 'myshixuns_count') + 'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count') to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8) to_shixun.user_id = user.id if laboratory From 7613d1c08d04c72cfcd385b0ebb0c59091b81789 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 19 Nov 2019 14:45:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/gits_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index b3ab4c13f..c73571fa2 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -38,7 +38,6 @@ class GitsController < ApplicationController else # 用户是否对对象拥有权限 system_user = User.find_by_login(input_username) || User.find_by_mail(input_username) || User.find_by_phone(input_username) - # 如果用户名密码错误 if system_user && !system_user.check_password?(input_password) uid_logger_error("git start: password is wrong") @@ -49,7 +48,7 @@ class GitsController < ApplicationController shixunname = git_url.split("/")[1].split(".")[0] repo_name = username + "/" + shixunname uid_logger("git start: repo_name is #{repo_name}") - shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name, laboratory_id: nil).first + shixun = Shixun.select([:id, :user_id, :repo_name, :identifier]).where(repo_name: repo_name).first uid_logger("git start auth: shixun identifier is #{shixun.try(:identifier)}") uid_logger("git start auth: systemuser is #{system_user.try(:login)}") From 46d61ef65a37f5503489b3395d88bc8ef3fe6200 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 19 Nov 2019 15:00:32 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/gits_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index c73571fa2..c9659302e 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -63,7 +63,7 @@ class GitsController < ApplicationController else uid_logger_error("shixun is not exist") # result = false - result = true # 为了测试跳出 + result = false # 为了测试跳出 end end end