修改已经提交过作业、再次提交报403

This commit is contained in:
sw 2014-11-05 10:54:39 +08:00
parent bc36e16e57
commit 5e91a258fe
1 changed files with 1 additions and 1 deletions

View File

@ -227,7 +227,7 @@ class HomeworkAttachController < ApplicationController
def create
bid = Bid.find params[:bid_id]
if User.current.admin? || User.current.member_of_course?(bid.courses.first) # modify by nwb
if bid.homeworks.where("user_id = ?",User.current).count == 0
if bid.homeworks.where("user_id = ?",User.current).empty?
user_id = params[:user_id]
bid_id = params[:bid_id]
if params[:homework_attach]