From c245ad09bba4350b92c572bc8fc08eca0faa0a0e Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sat, 13 Nov 2021 09:07:50 -0800 Subject: [PATCH] Make sure book is in the right format --- bookwyrm/importers/importer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bookwyrm/importers/importer.py b/bookwyrm/importers/importer.py index 4908e166a..71f02231c 100644 --- a/bookwyrm/importers/importer.py +++ b/bookwyrm/importers/importer.py @@ -145,6 +145,8 @@ def handle_imported_book(item): item.book = item.book.default_edition if not item.book: return + if not isinstance(item.book, models.Edition): + item.book = item.book.edition existing_shelf = models.ShelfBook.objects.filter(book=item.book, user=user).exists()