From ad2cf141cbca5170e953e2987e76a611a56c49fd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 26 Nov 2014 17:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=AB=9E=E8=B5=9B=E5=90=8E?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E7=AB=9E=E8=B5=9B=E4=B8=BB=E9=A1=B5=20=20=20?= =?UTF-8?q?#1600?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/contests_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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