From 910c0b13b3fe2e0fae05258c94426b4229a91671 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Tue, 2 Jul 2019 14:23:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=9E=E8=AE=AD=E5=8F=82?= =?UTF-8?q?=E6=95=B0=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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 767129026..65d671856 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -387,8 +387,6 @@ class ShixunsController < ApplicationController ShixunMirrorRepository.create(:shixun_id => @shixun.id, :mirror_repository_id => mirror) end end - logger.info("#######shixun_params: ##{shixun_params}") - logger.info("#######shixun_info_params: ##{shixun_info_params}") @shixun.update_attributes(shixun_params) @shixun.shixun_info.update_attributes(shixun_info_params) @shixun.shixun_schools.delete_all @@ -407,6 +405,8 @@ class ShixunsController < ApplicationController # 超级管理员和运营人员才能保存 中间层服务器pod信息的配置 if current_user.admin? || current_user.business? @shixun.shixun_service_configs.destroy_all + ActionController::Parameters.permit_all_parameters = true + logger.info("##--;;;;---#{params[:shixun_service_configs]}") params[:shixun_service_configs].each do |config| @shixun.shixun_service_configs.create!(config) end @@ -738,6 +738,7 @@ private :task_pass, :multi_webssh, :opening_time, :mirror_script_id, :code_hidden, :hide_code, :forbid_copy) end + def shixun_info_params raise("实训描述不能为空") if params[:shixun_info][:description].blank? raise("评测脚本不能为空") if params[:shixun_info][:evaluate_script].blank?