Merge branch 'cthulahoops-large_imports'

This commit is contained in:
Mouse Reeve
2020-05-02 17:08:52 -07:00
4 changed files with 8 additions and 4 deletions

View File

@ -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_13=self.isbn)
return Edition.objects.filter(isbn_13=self.isbn).first()
except Edition.DoesNotExist:
return None
@ -89,7 +89,7 @@ class ImportItem(models.Model):
def shelf(self):
''' the goodreads shelf field '''
if self.data['Exclusive Shelf']:
return GOODREADS_SHELVES[self.data['Exclusive Shelf']]
return GOODREADS_SHELVES.get(self.data['Exclusive Shelf'])
@property
def review(self):