Further fix delete books (#119)

This commit is contained in:
OzzieIsaacs 2017-04-15 18:07:53 +02:00
parent 9c679c8908
commit 2b8c29c535

View File

@ -1302,6 +1302,7 @@ def delete_book(book_id):
for c in cc: for c in cc:
cc_string = "custom_column_" + str(c.id) cc_string = "custom_column_" + str(c.id)
if not c.is_multiple: if not c.is_multiple:
if len(getattr(book, cc_string)) > 0:
if c.datatype == 'bool': if c.datatype == 'bool':
del_cc = getattr(book, cc_string)[0] del_cc = getattr(book, cc_string)[0]
getattr(book, cc_string).remove(del_cc) getattr(book, cc_string).remove(del_cc)