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
|
ls data | grep "$DATABASE" > /dev/null
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "Created data/books-backup.db"
|
echo "Created data/books-backup.sqlite"
|
||||||
mv "data/$DATABASE" data/books-backup.db
|
mv "data/$DATABASE" data/books-backup.sqlite
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sqlite3 "data/$DATABASE" < isbn_sort/schema.sql
|
sqlite3 "data/$DATABASE" < isbn_sort/schema.sql
|
@ -9,8 +9,9 @@ class Book:
|
|||||||
try:
|
try:
|
||||||
isbn = str(isbn).replace("-", "")
|
isbn = str(isbn).replace("-", "")
|
||||||
int(isbn)
|
int(isbn)
|
||||||
except ValueError:
|
except ValueError: # this can be ISBN-10
|
||||||
raise ValueError("ISBN must be an int")
|
pass
|
||||||
|
# raise ValueError("ISBN must be an int")
|
||||||
|
|
||||||
self.isbn = isbn
|
self.isbn = isbn
|
||||||
self.title = None
|
self.title = None
|
||||||
|
@ -62,8 +62,8 @@
|
|||||||
<td><p {% if book.publisher == None %}class="red"{% endif %}>{{ book.publisher }}</p></td>
|
<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><p {% if book.count != 1 %}class="red"{% endif %}>{{ book.count }}</p></td>
|
||||||
<td>
|
<td>
|
||||||
<button class="action" onclick="openEditBookDialog({{ book.isbn }})">✏️</button>
|
<button class="action" onclick='openEditBookDialog("{{ book.isbn }}")'>✏️</button>
|
||||||
<button class="action" onclick="openDeleteBookDialog({{ book.isbn }})">🗑️</button>
|
<button class="action" onclick='openDeleteBookDialog("{{ book.isbn }}")'>🗑️</button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user