1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-07 18:54:03 +00:00

Code refactoring and improved error handling for edit user list

Update teststatus
This commit is contained in:
Ozzie Isaacs
2021-04-04 19:40:34 +02:00
parent 665210e506
commit 8acd1f1fe4
18 changed files with 624 additions and 538 deletions

View File

@@ -147,8 +147,8 @@ def bind_oauth_or_register(provider_id, provider_user_id, redirect_url, provider
ub.session.commit()
flash(_(u"Link to %(oauth)s Succeeded", oauth=provider_name), category="success")
return redirect(url_for('web.profile'))
except Exception as e:
log.debug_or_exception(e)
except Exception as ex:
log.debug_or_exception(ex)
ub.session.rollback()
else:
flash(_(u"Login failed, No User Linked With OAuth Account"), category="error")
@@ -194,8 +194,8 @@ def unlink_oauth(provider):
ub.session.commit()
logout_oauth_user()
flash(_(u"Unlink to %(oauth)s Succeeded", oauth=oauth_check[provider]), category="success")
except Exception as e:
log.debug_or_exception(e)
except Exception as ex:
log.debug_or_exception(ex)
ub.session.rollback()
flash(_(u"Unlink to %(oauth)s Failed", oauth=oauth_check[provider]), category="error")
except NoResultFound: