修改已经提交过作业、再次提交报403
This commit is contained in:
parent
bc36e16e57
commit
5e91a258fe
|
@ -227,7 +227,7 @@ class HomeworkAttachController < ApplicationController
|
||||||
def create
|
def create
|
||||||
bid = Bid.find params[:bid_id]
|
bid = Bid.find params[:bid_id]
|
||||||
if User.current.admin? || User.current.member_of_course?(bid.courses.first) # modify by nwb
|
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]
|
user_id = params[:user_id]
|
||||||
bid_id = params[:bid_id]
|
bid_id = params[:bid_id]
|
||||||
if params[:homework_attach]
|
if params[:homework_attach]
|
||||||
|
|
Loading…
Reference in New Issue