From 9c1efcfa484369ba7ea0a4718b85d63d4d33bb45 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 26 Dec 2009 10:18:28 +0000 Subject: [PATCH] Do not display the copy form when project copy is created. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3242 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/controllers/projects_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 722893798..e908388ee 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -108,7 +108,13 @@ class ProjectsController < ApplicationController @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') flash[:notice] = l(:notice_successful_create) redirect_to :controller => 'admin', :action => 'projects' - end + 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 => 'admin', :action => 'projects' + end end rescue ActiveRecord::RecordNotFound redirect_to :controller => 'admin', :action => 'projects'