mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Don't crash on books with no isbn
This commit is contained in:
parent
095b60bff1
commit
a31d05c694
1 changed files with 4 additions and 2 deletions
|
@ -240,8 +240,10 @@ class Edition(Book):
|
|||
self.isbn_13 = isbn_10_to_13(self.isbn_10)
|
||||
|
||||
# normalize isbn format
|
||||
self.isbn_10 = re.sub(r"[^0-9X]", "", self.isbn_10)
|
||||
self.isbn_13 = re.sub(r"[^0-9X]", "", self.isbn_13)
|
||||
if self.isbn_10:
|
||||
self.isbn_10 = re.sub(r"[^0-9X]", "", self.isbn_10)
|
||||
if self.isbn_13:
|
||||
self.isbn_13 = re.sub(r"[^0-9X]", "", self.isbn_13)
|
||||
|
||||
# set rank
|
||||
self.edition_rank = self.get_rank()
|
||||
|
|
Loading…
Reference in a new issue