From b2ff9f3aadb47107509f23f0a33aef281c3fd6e1 Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Fri, 9 Mar 2018 15:56:56 +0800 Subject: [PATCH] Simplify redirect. --- app/controllers/trace_controller.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 5dd49c6be..ce2494001 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -192,11 +192,7 @@ class TraceController < ApplicationController trace.visible = false trace.save flash[:notice] = t "trace.delete.scheduled_for_deletion" - if current_user.administrator? || current_user.moderator? - redirect_to :action => :list, :display_name => trace.user.display_name - else - redirect_to :action => :list, :display_name => current_user.display_name - end + redirect_to :action => :list, :display_name => trace.user.display_name end rescue ActiveRecord::RecordNotFound head :not_found -- 2.43.2