mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
FIX: rescue error when importing category structure
This commit is contained in:
parent
f57d3c2315
commit
5849bae9df
1 changed files with 19 additions and 15 deletions
|
@ -76,6 +76,7 @@ module ImportExport
|
||||||
@categories.sort_by! { |c| c[:parent_category_id].presence || 0 }
|
@categories.sort_by! { |c| c[:parent_category_id].presence || 0 }
|
||||||
|
|
||||||
@categories.each do |cat_attrs|
|
@categories.each do |cat_attrs|
|
||||||
|
begin
|
||||||
id = cat_attrs.delete(:id)
|
id = cat_attrs.delete(:id)
|
||||||
permissions = cat_attrs.delete(:permissions_params)
|
permissions = cat_attrs.delete(:permissions_params)
|
||||||
|
|
||||||
|
@ -94,6 +95,9 @@ module ImportExport
|
||||||
post.save!
|
post.save!
|
||||||
post.rebake!
|
post.rebake!
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
|
next
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
self
|
self
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue