From 68372c3c433210e594ec3fec33b15c11187b539d Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 2 Apr 2020 09:11:42 -0700 Subject: [PATCH] Set work author for editions with no author --- fedireads/connectors/openlibrary.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fedireads/connectors/openlibrary.py b/fedireads/connectors/openlibrary.py index 4bb3036cc..95819f7d2 100644 --- a/fedireads/connectors/openlibrary.py +++ b/fedireads/connectors/openlibrary.py @@ -119,6 +119,9 @@ class Connector(AbstractConnector): author_id = author_blob['key'] author_id = author_id.split('/')[-1] book.authors.add(self.get_or_create_author(author_id)) + if not data.get('authors'): + book.authors.set(book.parent_work.authors.all()) + if book.sync_cover and data.get('covers') and len(data['covers']): book.cover.save(*self.get_cover(data['covers'][0]), save=True)