From e92f003ff38001e1611e5df2753bc6f122dd14f2 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Sun, 29 Dec 2019 00:39:13 +0100 Subject: datacite: check for empty title after clean --- python/fatcat_tools/importers/datacite.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'python/fatcat_tools') diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py index e1a746c7..fb945ba6 100644 --- a/python/fatcat_tools/importers/datacite.py +++ b/python/fatcat_tools/importers/datacite.py @@ -335,11 +335,14 @@ class DataciteImporter(EntityImporter): title, original_language_title, subtitle = parse_datacite_titles( titles) + if title is None: + print('[{}] skipping record w/o title: {}'.format(doi, obj), file=sys.stderr) + return False + + title = clean(title) if not title: print('[{}] skipping record w/o title: {}'.format(doi, obj), file=sys.stderr) return False - else: - title = clean(title) if not subtitle: subtitle = None -- cgit v1.2.3