2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

DEV: mbox importer improvements (#16557)

* FIX: support specifying parent_category_id in mbox import metadata
* FIX: elide tabs from topic titles
* FIX: optionally fix Mailman from: addresses
* DEV: optionally elide anything up to the last = in email addresses
* Fix Mailmain broken from: detection
This commit is contained in:
Leonardo Mosquera 2022-04-29 13:24:29 -03:00 committed by GitHub
parent 0f772bdf5b
commit 3e5faffb0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 69 additions and 13 deletions

View file

@ -458,7 +458,16 @@ class ImportScripts::Base
.where("LOWER(name) = ?", opts[:name].downcase.strip)
.first
return existing if existing
if existing
if import_id && existing.custom_fields["import_id"] != import_id
existing.custom_fields["import_id"] = import_id
existing.save!
add_category(import_id, existing)
end
return existing
end
post_create_action = opts.delete(:post_create_action)