Новости
=======
+Версия 0.3.2 (2024-03-??)
+-------------------------
+
+* Исправлена ошибка с повторным добавлением жанра книги.
+
Версия 0.3.1 (2024-02-25)
-------------------------
News
====
+Version 0.3.2 (2024-03-??)
+--------------------------
+
+* Fix a bug with adding the same genre to a book.
+
Version 0.3.1 (2024-02-25)
--------------------------
import os
from zipfile import ZipFile
-from sqlobject import sqlhub
+from sqlobject import dberrors, sqlhub
from sqlobject.sqlbuilder import Select
from .db import Author, Book, Extension, Genre, Language, \
for genre in genres.split(':'):
if genre:
genre_row = insert_name(Genre, genre, title=genre)
- book.addGenre(genre_row)
+ try:
+ book.addGenre(genre_row)
+ except dberrors.DuplicateEntryError:
+ pass # The genre has already been added
def tounicode(s):