mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 16:40:36 +00:00
Merge pull request #1107 from bookwyrm-social/no-edition-case
Correctly handles openlibrary works with no editions
This commit is contained in:
commit
8609c8eb79
1 changed files with 4 additions and 1 deletions
|
@ -76,7 +76,10 @@ class Connector(AbstractConnector):
|
|||
raise ConnectorException("Invalid book data")
|
||||
url = "%s%s/editions" % (self.books_url, key)
|
||||
data = get_data(url)
|
||||
return pick_default_edition(data["entries"])
|
||||
edition = pick_default_edition(data["entries"])
|
||||
if not edition:
|
||||
raise ConnectorException("No editions for work")
|
||||
return edition
|
||||
|
||||
def get_work_from_edition_data(self, data):
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue