aboutsummaryrefslogtreecommitdiffstats
path: root/python/fatcat_tools/importers/datacite.py
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-04-22 22:25:36 +0200
committerMartin Czygan <martin.czygan@gmail.com>2020-04-22 22:25:36 +0200
commite0baeade7924019c5bbd27d9a7c116a1e26854fc (patch)
tree866ef4e21dc03b524b7db497eae1b31bbd099c42 /python/fatcat_tools/importers/datacite.py
parent5576efabea5c3e5db1a8b57aef3dc4b4006dd46c (diff)
downloadfatcat-e0baeade7924019c5bbd27d9a7c116a1e26854fc.tar.gz
fatcat-e0baeade7924019c5bbd27d9a7c116a1e26854fc.zip
datacite: fix type error
Up to now, we expected the description to be a string or list. Add handling for int as well. First appeared: Apr 22 19:58:39.
Diffstat (limited to 'python/fatcat_tools/importers/datacite.py')
-rw-r--r--python/fatcat_tools/importers/datacite.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index 244984f5..d998f266 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -496,10 +496,12 @@ class DataciteImporter(EntityImporter):
if not desc.get('descriptionType') == 'Abstract':
continue
- # Description maybe a string or list.
+ # Description maybe a string, int or list.
text = desc.get('description', '')
if not text:
continue
+ if isinstance(text, int):
+ text = '{}'.format(text)
if isinstance(text, list):
try:
text = "\n".join(text)