aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2021-11-24 15:15:22 -0800
committerBryan Newbold <bnewbold@robocracy.org>2021-11-30 16:25:09 -0800
commit0d820674f17a03feee73ce38debf494c79003483 (patch)
tree94acb85f018c351e53d9dbdbbd96f83761beca1a
parent2260eefcb5b8f2d3d29be8e98b292b5e7d326844 (diff)
downloadfatcat-0d820674f17a03feee73ce38debf494c79003483.tar.gz
fatcat-0d820674f17a03feee73ce38debf494c79003483.zip
chocula importer: move issne/issnp 'extra' to top-level fields if doing updates
-rw-r--r--python/fatcat_tools/importers/chocula.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/python/fatcat_tools/importers/chocula.py b/python/fatcat_tools/importers/chocula.py
index e55be7d5..1ddefa5e 100644
--- a/python/fatcat_tools/importers/chocula.py
+++ b/python/fatcat_tools/importers/chocula.py
@@ -149,6 +149,12 @@ class ChoculaImporter(EntityImporter):
existing.wikidata_qid = existing.wikidata_qid or ce.wikidata_qid
existing.publisher = existing.publisher or ce.publisher
existing.container_type = existing.container_type or ce.container_type
+ existing.publication_status = existing.publication_status or ce.publication_status
+ # move issne/issnp from "extra" to top-level fields (new schema)
+ if not existing.issne:
+ existing.issne = existing.extra.pop("issne", None)
+ if not existing.issnp:
+ existing.issnp = existing.extra.pop("issnp", None)
existing.issne = existing.issne or ce.issne
existing.issnp = existing.issnp or ce.issnp
for k in ("urls", "webarchive_urls"):