Mantis importer: fixed default role mapping
git-svn-id: http://redmine.rubyforge.org/svn/trunk@638 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
f94be4f8ab
commit
7379d4e2d0
|
@ -51,12 +51,12 @@ task :migrate_from_mantis => :environment do
|
||||||
|
|
||||||
TARGET_TRACKER = Tracker.find :first
|
TARGET_TRACKER = Tracker.find :first
|
||||||
|
|
||||||
default_role = Role.find_by_position(3)
|
DEFAULT_ROLE = Role.find_by_position(3)
|
||||||
manager_role = Role.find_by_position(1)
|
manager_role = Role.find_by_position(1)
|
||||||
developer_role = Role.find_by_position(2)
|
developer_role = Role.find_by_position(2)
|
||||||
ROLE_MAPPING = {10 => default_role, # viewer
|
ROLE_MAPPING = {10 => DEFAULT_ROLE, # viewer
|
||||||
25 => default_role, # reporter
|
25 => DEFAULT_ROLE, # reporter
|
||||||
40 => default_role, # updater
|
40 => DEFAULT_ROLE, # updater
|
||||||
55 => developer_role, # developer
|
55 => developer_role, # developer
|
||||||
70 => manager_role, # manager
|
70 => manager_role, # manager
|
||||||
90 => manager_role # administrator
|
90 => manager_role # administrator
|
||||||
|
@ -271,7 +271,7 @@ task :migrate_from_mantis => :environment do
|
||||||
# Project members
|
# Project members
|
||||||
project.members.each do |member|
|
project.members.each do |member|
|
||||||
m = Member.new :user => User.find_by_id(users_map[member.user_id]),
|
m = Member.new :user => User.find_by_id(users_map[member.user_id]),
|
||||||
:role => ROLE_MAPPING[member.access_level] || default_role
|
:role => ROLE_MAPPING[member.access_level] || DEFAULT_ROLE
|
||||||
m.project = p
|
m.project = p
|
||||||
m.save
|
m.save
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue