Don't break on absent author name

This commit is contained in:
Mouse Reeve 2020-04-01 14:18:46 -07:00
parent 263b90599c
commit 772ba1840b

View file

@ -168,6 +168,7 @@ class Connector(AbstractConnector):
author = update_from_mappings(author, data, mappings) author = update_from_mappings(author, data, mappings)
# TODO this is making some BOLD assumption # TODO this is making some BOLD assumption
name = data.get('name') name = data.get('name')
if name:
author.last_name = name.split(' ')[-1] author.last_name = name.split(' ')[-1]
author.first_name = ' '.join(name.split(' ')[:-1]) author.first_name = ' '.join(name.split(' ')[:-1])
author.save() author.save()