From 5d363da175faa8289d94e51778af281add117178 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 3 Jul 2022 11:05:20 -0700 Subject: [PATCH] Handle getting edition data as dict or string --- bookwyrm/connectors/inventaire.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bookwyrm/connectors/inventaire.py b/bookwyrm/connectors/inventaire.py index 3d5f913bd..df9b2e43a 100644 --- a/bookwyrm/connectors/inventaire.py +++ b/bookwyrm/connectors/inventaire.py @@ -160,12 +160,13 @@ class Connector(AbstractConnector): def create_edition_from_data(self, work, edition_data, instance=None): """pass in the url as data and then call the version in abstract connector""" - try: - data = self.get_book_data(edition_data) - except ConnectorException: - # who, indeed, knows - return - super().create_edition_from_data(work, data, instance=instance) + if isinstance(edition_data, str): + try: + edition_data = self.get_book_data(edition_data) + except ConnectorException: + # who, indeed, knows + return + super().create_edition_from_data(work, edition_data, instance=instance) def get_cover_url(self, cover_blob, *_): """format the relative cover url into an absolute one: