aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2019-12-29 00:39:13 +0100
committerMartin Czygan <martin.czygan@gmail.com>2019-12-29 00:40:39 +0100
commite92f003ff38001e1611e5df2753bc6f122dd14f2 (patch)
treef8a3b18816067a2ce77c119d350fe7f5b8d42771 /python/fatcat_tools/importers
parentb49cbfd528f3aa02beb2e0d1f76658e4dff0aa22 (diff)
downloadfatcat-e92f003ff38001e1611e5df2753bc6f122dd14f2.tar.gz
fatcat-e92f003ff38001e1611e5df2753bc6f122dd14f2.zip
datacite: check for empty title after clean
Diffstat (limited to 'python/fatcat_tools/importers')
-rw-r--r--python/fatcat_tools/importers/datacite.py7
1 files changed, 5 insertions, 2 deletions
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