From 64f9e12b1dfa156945943115dc8bdbffb3b8a556 Mon Sep 17 00:00:00 2001 From: Adam Kelly Date: Tue, 28 Apr 2020 15:27:06 +0100 Subject: [PATCH] Isbns aren't necessarily always unique. --- fedireads/models/import_job.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedireads/models/import_job.py b/fedireads/models/import_job.py index 28555c0fd..1c35282e6 100644 --- a/fedireads/models/import_job.py +++ b/fedireads/models/import_job.py @@ -61,7 +61,7 @@ class ImportItem(models.Model): def get_book_from_db_isbn(self): ''' see if we already know about the book ''' try: - return Edition.objects.get(isbn=self.isbn) + return Edition.objects.filter(isbn=self.isbn).first() except Edition.DoesNotExist: return None