删除竞赛后跳到竞赛主页 #1600
This commit is contained in:
parent
86413df277
commit
ad2cf141cb
|
@ -188,10 +188,10 @@ class ContestsController < ApplicationController
|
|||
# Added by Longjun
|
||||
def destroy_contest
|
||||
@contest = Contest.find(params[:id])
|
||||
if @contest.author_id == User.current.id
|
||||
if @contest.author_id == User.current.id || User.current.admin?
|
||||
|
||||
@contest.destroy
|
||||
redirect_to action: 'index'
|
||||
redirect_to welcome_contest_url
|
||||
else
|
||||
render_403 :message => :notice_not_contest_delete_authorized
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue