Clear subtask assignee during copy if is locked (#28946).

Patch by Marius BALTEANU.


git-svn-id: http://svn.redmine.org/redmine/trunk@17390 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2018-06-17 01:03:04 +00:00
parent 5f55268756
commit 74d775166a
2 changed files with 20 additions and 0 deletions

View File

@@ -1642,6 +1642,7 @@ class Issue < ActiveRecord::Base
copy.project = project
copy.parent_issue_id = copied_issue_ids[child.parent_id]
copy.fixed_version_id = nil unless child.fixed_version.present? && child.fixed_version.status == 'open'
copy.assigned_to = nil unless child.assigned_to_id.present? && child.assigned_to.status == User::STATUS_ACTIVE
unless copy.save
logger.error "Could not copy subtask ##{child.id} while copying ##{@copied_from.id} to ##{id} due to validation errors: #{copy.errors.full_messages.join(', ')}" if logger
next