From eb383a232a64270e26457e17e74adf26934b541c Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Mon, 30 Dec 2019 18:03:07 +0100 Subject: datacite: perform additional checks on contrib --- python/fatcat_tools/importers/datacite.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'python/fatcat_tools/importers') 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, )) -- cgit v1.2.3