summaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-04-20 20:52:10 +0200
committerMartin Czygan <martin.czygan@gmail.com>2020-04-20 20:52:10 +0200
commit7c6febf20c84dd4f5778e1fb02369456f7dad344 (patch)
tree851f86e3a5097f7bc3a6df8171dfb08d17fe1820 /python/fatcat_tools
parente749b576bdb9bbec3bcef7e4e389e7fbbf916c84 (diff)
downloadfatcat-7c6febf20c84dd4f5778e1fb02369456f7dad344.tar.gz
fatcat-7c6febf20c84dd4f5778e1fb02369456f7dad344.zip
datacite: fix a raw name constraint violation
It was possible that contribs got added which had no raw name. One example would be a name consisting of whitespace only. This fix adds a final check for this case.
Diffstat (limited to 'python/fatcat_tools')
-rw-r--r--python/fatcat_tools/importers/datacite.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index 81f00876..244984f5 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -758,6 +758,14 @@ class DataciteImporter(EntityImporter):
given_name = clean(given_name)
if surname:
surname = clean(surname)
+
+ # Perform a final assertion that name does not reduce to zero
+ # (e.g. whitespace only name).
+ if name:
+ name = name.strip()
+ if not name:
+ continue
+
if raw_affiliation == '':
continue