From 772ba1840b0fd6be5b67d4531e0bf3f77b14e33c Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 1 Apr 2020 14:18:46 -0700 Subject: [PATCH] Don't break on absent author name --- fedireads/connectors/openlibrary.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fedireads/connectors/openlibrary.py b/fedireads/connectors/openlibrary.py index 53be173df..dd68920d2 100644 --- a/fedireads/connectors/openlibrary.py +++ b/fedireads/connectors/openlibrary.py @@ -168,8 +168,9 @@ class Connector(AbstractConnector): author = update_from_mappings(author, data, mappings) # TODO this is making some BOLD assumption name = data.get('name') - author.last_name = name.split(' ')[-1] - author.first_name = ' '.join(name.split(' ')[:-1]) + if name: + author.last_name = name.split(' ')[-1] + author.first_name = ' '.join(name.split(' ')[:-1]) author.save() return author