From dd07544a44fdd7d3e9ba6084ad7b8c3cf6584866 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Fri, 19 Apr 2024 11:30:55 +0200 Subject: [PATCH] Fix for ISBN-10 --- init.sh | 4 ++-- isbn_sort/book.py | 5 +++-- isbn_sort/templates/index.html | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/init.sh b/init.sh index 2546f81..8ab13cd 100755 --- a/init.sh +++ b/init.sh @@ -7,8 +7,8 @@ mkdir -p data ls data | grep "$DATABASE" > /dev/null if [ $? -eq 0 ]; then - echo "Created data/books-backup.db" - mv "data/$DATABASE" data/books-backup.db + echo "Created data/books-backup.sqlite" + mv "data/$DATABASE" data/books-backup.sqlite fi sqlite3 "data/$DATABASE" < isbn_sort/schema.sql \ No newline at end of file diff --git a/isbn_sort/book.py b/isbn_sort/book.py index f4d7c2f..b273399 100644 --- a/isbn_sort/book.py +++ b/isbn_sort/book.py @@ -9,8 +9,9 @@ class Book: try: isbn = str(isbn).replace("-", "") int(isbn) - except ValueError: - raise ValueError("ISBN must be an int") + except ValueError: # this can be ISBN-10 + pass + # raise ValueError("ISBN must be an int") self.isbn = isbn self.title = None diff --git a/isbn_sort/templates/index.html b/isbn_sort/templates/index.html index 344cc28..4255d1f 100644 --- a/isbn_sort/templates/index.html +++ b/isbn_sort/templates/index.html @@ -62,8 +62,8 @@

{{ book.publisher }}

{{ book.count }}

- - + + {% endfor %}