Find role and tracker only when param is present.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9994 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-07-15 15:39:36 +00:00
parent 5097f51784
commit 712e5be29f
1 changed files with 4 additions and 4 deletions

View File

@ -25,8 +25,8 @@ class WorkflowsController < ApplicationController
end
def edit
@role = Role.find_by_id(params[:role_id])
@tracker = Tracker.find_by_id(params[:tracker_id])
@role = Role.find_by_id(params[:role_id]) if params[:role_id]
@tracker = Tracker.find_by_id(params[:tracker_id]) if params[:tracker_id]
if request.post?
WorkflowTransition.destroy_all( ["role_id=? and tracker_id=?", @role.id, @tracker.id])
@ -59,8 +59,8 @@ class WorkflowsController < ApplicationController
end
def permissions
@role = Role.find_by_id(params[:role_id])
@tracker = Tracker.find_by_id(params[:tracker_id])
@role = Role.find_by_id(params[:role_id]) if params[:role_id]
@tracker = Tracker.find_by_id(params[:tracker_id]) if params[:tracker_id]
if @role && @tracker
if request.post?