FIX: group import/export bugs in category exporter
This commit is contained in:
parent
d41cbc5a30
commit
0d611ed8cb
|
@ -35,11 +35,11 @@ module ImportExport
|
|||
|
||||
# export groups that are mentioned in category permissions
|
||||
group_names = []
|
||||
auto_group_names = Group::AUTO_GROUPS.keys
|
||||
auto_group_names = Group::AUTO_GROUPS.keys.map(&:to_s)
|
||||
|
||||
([@export_data[:category]] + @export_data[:subcategories]).each do |c|
|
||||
c[:permissions_params].each do |group_name, _|
|
||||
group_names << group_name unless auto_group_names.include?(group_name)
|
||||
group_names << group_name unless auto_group_names.include?(group_name.to_s)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ module ImportExport
|
|||
external_id = g.delete(:id)
|
||||
new_group = Group.find_by_name(g[:name]) || Group.create!(g)
|
||||
user_ids.each do |external_user_id|
|
||||
new_group.add( User.find(@topic_importer.new_user_id(external_user_id)) )
|
||||
new_group.add( User.find(@topic_importer.new_user_id(external_user_id)) ) rescue ActiveRecord::RecordNotUnique
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue