aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2019-12-30 18:03:07 +0100
committerMartin Czygan <martin.czygan@gmail.com>2019-12-30 18:03:07 +0100
commiteb383a232a64270e26457e17e74adf26934b541c (patch)
tree9271fdaae6396dd6a08b1d29388eb426bb0f88c7 /python
parente92f003ff38001e1611e5df2753bc6f122dd14f2 (diff)
downloadfatcat-eb383a232a64270e26457e17e74adf26934b541c.tar.gz
fatcat-eb383a232a64270e26457e17e74adf26934b541c.zip
datacite: perform additional checks on contrib
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/datacite.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index fb945ba6..f681b51b 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -307,13 +307,19 @@ class DataciteImporter(EntityImporter):
if surname:
surname = clean(surname)
+ if not name:
+ continue
+
+ if raw_affiliation is not None and not raw_affiliation:
+ continue
+
contribs.append(
fatcat_openapi_client.ReleaseContrib(
creator_id=creator_id,
index=i,
- raw_name=c.get('name'),
- given_name=c.get('givenName'),
- surname=c.get('familyName'),
+ raw_name=name,
+ given_name=given_name,
+ surname=surname,
role='author',
raw_affiliation=raw_affiliation,
))