mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 17:05:30 +02:00
Merged r14619 (#20282).
git-svn-id: http://svn.redmine.org/redmine/branches/3.0-stable@14650 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -680,12 +680,14 @@ class Project < ActiveRecord::Base
|
||||
attrs = attrs.deep_dup
|
||||
|
||||
@unallowed_parent_id = nil
|
||||
parent_id_param = attrs['parent_id'].to_s
|
||||
if parent_id_param.blank? || parent_id_param != parent_id.to_s
|
||||
p = parent_id_param.present? ? Project.find_by_id(parent_id_param) : nil
|
||||
unless allowed_parents(user).include?(p)
|
||||
attrs.delete('parent_id')
|
||||
@unallowed_parent_id = true
|
||||
if new_record? || attrs.key?('parent_id')
|
||||
parent_id_param = attrs['parent_id'].to_s
|
||||
if new_record? || parent_id_param != parent_id.to_s
|
||||
p = parent_id_param.present? ? Project.find_by_id(parent_id_param) : nil
|
||||
unless allowed_parents(user).include?(p)
|
||||
attrs.delete('parent_id')
|
||||
@unallowed_parent_id = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user