Simplify redirect.
authorAndy Allan <git@gravitystorm.co.uk>
Fri, 9 Mar 2018 07:56:56 +0000 (15:56 +0800)
committerAndy Allan <git@gravitystorm.co.uk>
Fri, 9 Mar 2018 07:56:56 +0000 (15:56 +0800)
app/controllers/trace_controller.rb

index 5dd49c6..ce24940 100644 (file)
@@ -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