From d98b959a80c6b58f15e854b2c2d60df57e1039d2 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 27 Mar 2020 10:58:20 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/examination_banks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/examination_banks_controller.rb b/app/controllers/examination_banks_controller.rb index 4cb25aa29..96cab6b7f 100644 --- a/app/controllers/examination_banks_controller.rb +++ b/app/controllers/examination_banks_controller.rb @@ -52,7 +52,7 @@ class ExaminationBanksController < ApplicationController end def destroy - tip_exception(403, "无权限") unless current_user.admin? || @item.user == current_user + tip_exception(403, "无权限") unless current_user.admin? || @exam.user == current_user ActiveRecord::Base.transaction do ApplyAction.where(container_type: "ExaminationBank", container_id: @exam.id).destroy_all @exam.destroy! From b46e7f0887018ad52424e90c5ef5108dd970c5ce Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 27 Mar 2020 11:27:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index b96ab0d4b..9c8947fdb 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -137,7 +137,7 @@ class ExercisesController < ApplicationController :course_id => @course.id, :time => -1, :exercise_status => 1, - :is_md => params[:md] + :is_md => params[:is_md] } @exercise = Exercise.create!(exercise_options) end