mirror of
https://github.com/janeczku/calibre-web
synced 2025-10-24 11:57:40 +00:00
Merge branch 'master' into Develop
# Conflicts: # cps/editbooks.py # requirements.txt # setup.cfg # test/Calibre-Web TestSummary_Linux.html
This commit is contained in:
@@ -28,7 +28,6 @@ from uuid import uuid4
|
||||
from markupsafe import escape, Markup # dependency of flask
|
||||
from functools import wraps
|
||||
|
||||
|
||||
from flask import Blueprint, request, flash, redirect, url_for, abort, Response
|
||||
from flask_babel import gettext as _
|
||||
from flask_babel import lazy_gettext as N_
|
||||
@@ -1000,17 +999,6 @@ def edit_book_comments(comments, book):
|
||||
modify_date = False
|
||||
if comments:
|
||||
comments = clean_string(comments, book.id)
|
||||
#try:
|
||||
# if BLEACH:
|
||||
# comments = clean_html(comments, tags=set(), attributes=set())
|
||||
# else:
|
||||
# comments = clean_html(comments)
|
||||
#except ParserError as e:
|
||||
# log.error("Comments of book {} are corrupted: {}".format(book.id, e))
|
||||
# comments = ""
|
||||
#except TypeError as e:
|
||||
# log.error("Comments can't be parsed, maybe 'lxml' is too new, try installing 'bleach': {}".format(e))
|
||||
# comments = ""
|
||||
if len(book.comments):
|
||||
if book.comments[0].text != comments:
|
||||
book.comments[0].text = comments
|
||||
@@ -1069,18 +1057,6 @@ def edit_cc_data_value(book_id, book, c, to_save, cc_db_value, cc_string):
|
||||
to_save[cc_string] = Markup(to_save[cc_string]).unescape()
|
||||
if to_save[cc_string]:
|
||||
to_save[cc_string] = clean_string(to_save[cc_string], book_id)
|
||||
#try:
|
||||
# if BLEACH:
|
||||
# to_save[cc_string] = clean_html(to_save[cc_string], tags=set(), attributes=set())
|
||||
# else:
|
||||
# to_save[cc_string] = clean_html(to_save[cc_string])
|
||||
#except ParserError as e:
|
||||
# log.error("Customs Comments of book {} are corrupted: {}".format(book_id, e))
|
||||
# to_save[cc_string] = ""
|
||||
#except TypeError as e:
|
||||
# to_save[cc_string] = ""
|
||||
# log.error("Customs Comments can't be parsed, maybe 'lxml' is too new, "
|
||||
# "try installing 'bleach': {}".format(e))
|
||||
elif c.datatype == 'datetime':
|
||||
try:
|
||||
to_save[cc_string] = datetime.strptime(to_save[cc_string], "%Y-%m-%d")
|
||||
@@ -1313,8 +1289,6 @@ def search_objects_remove(db_book_object, db_type, input_elements):
|
||||
del_elements = []
|
||||
for c_elements in db_book_object:
|
||||
found = False
|
||||
#if db_type == 'languages':
|
||||
# type_elements = c_elements.lang_code
|
||||
if db_type == 'custom':
|
||||
type_elements = c_elements.value
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user