Fixed: should redirect to the new project when copying a project.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4616 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
ce8113dea2
commit
2d9b9362a9
|
@ -124,13 +124,13 @@ class ProjectsController < ApplicationController
|
|||
if validate_parent_id && @project.copy(@source_project, :only => params[:only])
|
||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
||||
flash[:notice] = l(:notice_successful_create)
|
||||
redirect_to :controller => 'projects', :action => 'settings'
|
||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
||||
elsif !@project.new_record?
|
||||
# Project was created
|
||||
# But some objects were not copied due to validation failures
|
||||
# (eg. issues from disabled trackers)
|
||||
# TODO: inform about that
|
||||
redirect_to :controller => 'projects', :action => 'settings'
|
||||
redirect_to :controller => 'projects', :action => 'settings', :id => @project
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -429,7 +429,7 @@ class ProjectsControllerTest < ActionController::TestCase
|
|||
@request.session[:user_id] = 1 # admin
|
||||
post :copy, :id => 1, :project => {:name => 'Copy', :identifier => 'unique-copy'}
|
||||
assert_response :redirect
|
||||
assert_redirected_to :controller => 'projects', :action => 'settings'
|
||||
assert_redirected_to :controller => 'projects', :action => 'settings', :id => 'unique-copy'
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue