Merge pull request #1172 from bookwyrm-social/import-lookup

Don't try title/author search when isbn search fails
This commit is contained in:
Mouse Reeve 2021-06-14 12:49:54 -07:00 committed by GitHub
commit 6d42f2bb1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,7 +75,12 @@ class ImportItem(models.Model):
def resolve(self):
"""try various ways to lookup a book"""
self.book = self.get_book_from_isbn() or self.get_book_from_title_author()
if self.isbn:
self.book = self.get_book_from_isbn()
else:
# don't fall back on title/author search is isbn is present.
# you're too likely to mismatch
self.get_book_from_title_author()
def get_book_from_isbn(self):
"""search by isbn"""