From 7c6febf20c84dd4f5778e1fb02369456f7dad344 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Mon, 20 Apr 2020 20:52:10 +0200 Subject: 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. --- python/fatcat_tools/importers/datacite.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python/fatcat_tools') 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 -- cgit v1.2.3