diff --git a/openlibrary/plugins/upstream/mybooks.py b/openlibrary/plugins/upstream/mybooks.py index 749578609b0..5ea94643238 100644 --- a/openlibrary/plugins/upstream/mybooks.py +++ b/openlibrary/plugins/upstream/mybooks.py @@ -60,9 +60,14 @@ def GET(self, username, key='want-to-read'): 'work': { 'title': w.get('title'), 'key': w.key, - 'author_keys': [a.author.key for a in w.get('authors', [])], + 'author_keys': [ + a.author.get("key") + for a in w.get('authors', []) if a.author + ], 'author_names': [ - str(a.author.name) for a in w.get('authors', []) + str(a.author.name) + for a in w.get('authors', []) + if type(a.author) is not str ], 'first_publish_year': w.first_publish_year or None, 'lending_edition_s': (