diff --git a/app/controllers/homework_attach_controller.rb b/app/controllers/homework_attach_controller.rb index 2922eea1a..311d9c1a8 100644 --- a/app/controllers/homework_attach_controller.rb +++ b/app/controllers/homework_attach_controller.rb @@ -196,7 +196,7 @@ class HomeworkAttachController < ApplicationController def destroy #@homework = HomeworkAttach.find(params[:id]) - if User.current.admin? || User.current == @homework + if User.current.admin? || User.current == @homework.user if @homework.destroy respond_to do |format| format.html { redirect_to course_for_bid_path @homework.bid }