1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-18 22:20:30 +00:00

Merge branch 'master' into Develop

This commit is contained in:
Ozzie Isaacs 2023-03-04 11:13:57 +01:00
commit 28eeb9eec3
7 changed files with 155 additions and 1529 deletions

View File

@ -163,7 +163,7 @@ def queue_metadata_backup():
show_text = {} show_text = {}
log.warning("Queuing all books for metadata backup") log.warning("Queuing all books for metadata backup")
helper.set_all_metadata_dirty() helper.set_all_metadata_dirty()
show_text['text'] = _('Success! Books queued for Metadata Backup') show_text['text'] = _('Success! Books queued for Metadata Backup, please check Tasks for result')
return json.dumps(show_text) return json.dumps(show_text)
@ -1940,10 +1940,10 @@ def _delete_user(content):
log.info("User {} deleted".format(content.name)) log.info("User {} deleted".format(content.name))
return _("User '%(nick)s' deleted", nick=content.name) return _("User '%(nick)s' deleted", nick=content.name)
else: else:
log.warning(_("Can't delete Guest User")) # log.warning(_("Can't delete Guest User"))
raise Exception(_("Can't delete Guest User")) raise Exception(_("Can't delete Guest User"))
else: else:
log.warning("No admin user remaining, can't delete user") # log.warning("No admin user remaining, can't delete user")
raise Exception(_("No admin user remaining, can't delete user")) raise Exception(_("No admin user remaining, can't delete user"))
@ -1995,7 +1995,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support):
else: else:
content.role &= ~constants.ROLE_ANONYMOUS content.role &= ~constants.ROLE_ANONYMOUS
if to_save.get("password", ""): if to_save.get("password", ""):
content.password = generate_password_hash(helper.valid_password(to_save.get["password"])) content.password = generate_password_hash(helper.valid_password(to_save.get("password", "")))
new_email = valid_email(to_save.get("email", content.email)) new_email = valid_email(to_save.get("email", content.email))
if not new_email: if not new_email:

View File

@ -89,7 +89,6 @@ class TaskBackupMetadata(CalibreTask):
self.open_metadata(book, custom_columns) self.open_metadata(book, custom_columns)
else: else:
self.log.error("Book {} not found in database".format(backup.book)) self.log.error("Book {} not found in database".format(backup.book))
# self._handleError("Book {} not found in database".format(backup.book))
i += 1 i += 1
self.progress = (1.0 / count) * i self.progress = (1.0 / count) * i
self._handleSuccess() self._handleSuccess()
@ -230,9 +229,8 @@ class TaskBackupMetadata(CalibreTask):
try: try:
with open(book_metadata_filepath, 'wb') as f: with open(book_metadata_filepath, 'wb') as f:
doc.write(f, xml_declaration=True, encoding='utf-8', pretty_print=True) doc.write(f, xml_declaration=True, encoding='utf-8', pretty_print=True)
except Exception: except Exception as ex:
# ToDo: Folder not writeable error raise Exception('Writing Metadata failed with error: {} '.format(ex))
pass
@property @property
def name(self): def name(self):

View File

@ -1423,7 +1423,7 @@ def change_profile(kobo_support, local_oauth_check, oauth_status, translations,
try: try:
if current_user.role_passwd() or current_user.role_admin(): if current_user.role_passwd() or current_user.role_admin():
if to_save.get("password", "") != "": if to_save.get("password", "") != "":
current_user.password = generate_password_hash(to_save.get("password")) current_user.password = generate_password_hash(valid_password(to_save.get("password")))
if to_save.get("kindle_mail", current_user.kindle_mail) != current_user.kindle_mail: if to_save.get("kindle_mail", current_user.kindle_mail) != current_user.kindle_mail:
current_user.kindle_mail = valid_email(to_save.get("kindle_mail")) current_user.kindle_mail = valid_email(to_save.get("kindle_mail"))
new_email = valid_email(to_save.get("email", current_user.email)) new_email = valid_email(to_save.get("email", current_user.email))

View File

@ -37,7 +37,7 @@ beautifulsoup4>=4.0.1,<4.12.0
cchardet>=2.0.0,<2.2.0 cchardet>=2.0.0,<2.2.0
# Comics # Comics
natsort>=2.2.0,<8.3.0 natsort>=2.2.0,<8.4.0
comicapi>=2.2.0,<2.3.0 comicapi>=2.2.0,<2.3.0
# Kobo integration # Kobo integration

View File

@ -7,9 +7,9 @@ Flask-Principal>=0.3.2,<0.5.1
backports_abc>=0.4 backports_abc>=0.4
Flask>=1.0.2,<2.3.0 Flask>=1.0.2,<2.3.0
iso-639>=0.4.5,<0.5.0 iso-639>=0.4.5,<0.5.0
PyPDF==3.4.0 PyPDF==3.6.0
pytz>=2016.10 pytz>=2016.10
requests>=2.11.1,<2.28.0 requests>=2.11.1,<2.29.0
SQLAlchemy>=1.3.0,<2.0.0 SQLAlchemy>=1.3.0,<2.0.0
tornado>=4.1,<6.3 tornado>=4.1,<6.3
Wand>=0.4.4,<0.7.0 Wand>=0.4.4,<0.7.0
@ -18,4 +18,4 @@ lxml>=3.8.0,<5.0.0
flask-wtf>=0.14.2,<1.2.0 flask-wtf>=0.14.2,<1.2.0
chardet>=3.0.0,<4.1.0 chardet>=3.0.0,<4.1.0
advocate>=1.0.0,<1.1.0 advocate>=1.0.0,<1.1.0
Flask-Limiter>=2.3.0,<3.3.0 Flask-Limiter>=2.3.0,<3.4.0

View File

@ -58,7 +58,7 @@ install_requires =
flask-wtf>=0.14.2,<1.2.0 flask-wtf>=0.14.2,<1.2.0
chardet>=3.0.0,<4.1.0 chardet>=3.0.0,<4.1.0
advocate>=1.0.0,<1.1.0 advocate>=1.0.0,<1.1.0
Flask-Limiter>=2.3.0,<3.2.0 Flask-Limiter>=2.3.0,<3.3.0
[options.extras_require] [options.extras_require]

File diff suppressed because it is too large Load Diff