Fix for ISBN-10
This commit is contained in:
parent
e48339e245
commit
dd07544a44
4
init.sh
4
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
|
@ -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
|
||||
|
@ -62,8 +62,8 @@
|
||||
<td><p {% if book.publisher == None %}class="red"{% endif %}>{{ book.publisher }}</p></td>
|
||||
<td><p {% if book.count != 1 %}class="red"{% endif %}>{{ book.count }}</p></td>
|
||||
<td>
|
||||
<button class="action" onclick="openEditBookDialog({{ book.isbn }})">✏️</button>
|
||||
<button class="action" onclick="openDeleteBookDialog({{ book.isbn }})">🗑️</button>
|
||||
<button class="action" onclick='openEditBookDialog("{{ book.isbn }}")'>✏️</button>
|
||||
<button class="action" onclick='openDeleteBookDialog("{{ book.isbn }}")'>🗑️</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user