From 353914768e4d96b424dd0501a661797a8b15eb2c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 5 Apr 2017 15:59:43 +0000 Subject: [PATCH] Code cleanup. git-svn-id: http://svn.redmine.org/redmine/trunk@16490 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/roles_controller.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index a09455949..d134e1f67 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -92,10 +92,11 @@ class RolesController < ApplicationController end def destroy - @role.destroy - redirect_to roles_path - rescue - flash[:error] = l(:error_can_not_remove_role) + begin + @role.destroy + rescue + flash[:error] = l(:error_can_not_remove_role) + end redirect_to roles_path end -- 2.39.5