Skip to content

Commit

Permalink
Bugfix after merge
Browse files Browse the repository at this point in the history
Bugfix generate Metadata backup
  • Loading branch information
OzzieIsaacs committed Mar 3, 2023
1 parent 3cf778b commit 64e9b13
Show file tree
Hide file tree
Showing 5 changed files with 1,566 additions and 1,609 deletions.
4 changes: 2 additions & 2 deletions cps/admin.py
Expand Up @@ -163,7 +163,7 @@ def queue_metadata_backup():
show_text = {}
log.warning("Queuing all books for metadata backup")
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)


Expand Down Expand Up @@ -1995,7 +1995,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support):
else:
content.role &= ~constants.ROLE_ANONYMOUS
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))
if not new_email:
Expand Down
6 changes: 2 additions & 4 deletions cps/tasks/metadata_backup.py
Expand Up @@ -89,7 +89,6 @@ def backup_metadata(self):
self.open_metadata(book, custom_columns)
else:
self.log.error("Book {} not found in database".format(backup.book))
# self._handleError("Book {} not found in database".format(backup.book))
i += 1
self.progress = (1.0 / count) * i
self._handleSuccess()
Expand Down Expand Up @@ -230,9 +229,8 @@ def create_new_metadata_backup(self, book, custom_columns, book_metadata_filepa
try:
with open(book_metadata_filepath, 'wb') as f:
doc.write(f, xml_declaration=True, encoding='utf-8', pretty_print=True)
except Exception:
# ToDo: Folder not writeable error
pass
except Exception as ex:
raise Exception('Writing Metadata failed with error: {} '.format(ex))

@property
def name(self):
Expand Down
2 changes: 1 addition & 1 deletion cps/web.py
Expand Up @@ -1423,7 +1423,7 @@ def change_profile(kobo_support, local_oauth_check, oauth_status, translations,
try:
if current_user.role_passwd() or current_user.role_admin():
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:
current_user.kindle_mail = valid_email(to_save.get("kindle_mail"))
new_email = valid_email(to_save.get("email", current_user.email))
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Expand Up @@ -58,7 +58,7 @@ install_requires =
flask-wtf>=0.14.2,<1.2.0
chardet>=3.0.0,<4.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]
Expand Down

0 comments on commit 64e9b13

Please sign in to comment.