From 289fb393bfa8b63bddc65c7a3afe13ef537f6bc4 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 21 May 2015 17:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E4=BD=9C=E5=93=81=EF=BC=9A?= =?UTF-8?q?=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E4=B8=BA=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E7=9A=84=E4=BD=9C=E8=80=85=20&&=20=EF=BC=88=E6=9C=AA=E5=BC=80?= =?UTF-8?q?=E5=90=AF=E5=8C=BF=E8=AF=84=20||=20=E6=9C=AA=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index d619b1cd7..f9d393ca3 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -81,7 +81,8 @@ class StudentWorkController < ApplicationController #获取作品 def find_work @work = StudentWork.find params[:id] - @course = @work.homework_common.course + @homework = @work.homework_common + @course = @homework.course rescue render_404 end @@ -95,6 +96,6 @@ class StudentWorkController < ApplicationController #判断是不是当前作品的提交者 #提交者可以编辑作品 def author_of_work - render_403 unless User.current.id == @work.user_id + render_403 unless User.current.id == @work.user_id && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1 ) end end \ No newline at end of file