Do not raise an error when destroying a Version with assigned issues.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3668 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2010-04-11 17:47:29 +00:00
parent c76b9edf6c
commit 9ccccb9984
2 changed files with 11 additions and 13 deletions

View File

@@ -80,11 +80,13 @@ class VersionsController < ApplicationController
end
def destroy
@version.destroy
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
rescue
flash[:error] = l(:notice_unable_delete_version)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
if @version.fixed_issues.empty?
@version.destroy
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
else
flash[:error] = l(:notice_unable_delete_version)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
end
end
def status_by