Returns an error when the driver couldn't decrypt the password, and

let the user know the issue.
pull/3/head
Ashesh Vashi 2016-02-22 14:03:02 +05:30
parent bbf037f005
commit c3b0e1dec4
1 changed files with 9 additions and 1 deletions

View File

@ -102,7 +102,15 @@ class Connection(BaseConnection):
if user is None:
return False, gettext("Unauthorized Request.")
try:
password = decrypt(encpass, user.password)
except Exception as e:
current_app.logger.exception(e)
return False, \
_("Failed to decrypt the saved password!\nError: {0}").format(
str(e)
)
# password is in bytes, for python3 we need it in string
if isinstance(password, bytes):
password = password.decode()