diff --git a/app/controllers/contests_controller.rb b/app/controllers/contests_controller.rb index 627e1945b..af532cd87 100644 --- a/app/controllers/contests_controller.rb +++ b/app/controllers/contests_controller.rb @@ -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