fix error handling (errors were returning 500)
This commit is contained in:
parent
7a3d365928
commit
0dcdabe339
7
app.py
7
app.py
|
@ -33,10 +33,9 @@ def post_index():
|
|||
try:
|
||||
ldap_change_password(form('username'),
|
||||
form('old-password'), form('new-password'))
|
||||
except Error as e:
|
||||
print("Unsuccessful attemp to change password for {}: {}"
|
||||
.format(form('username'), str(e)))
|
||||
return error(str(e))
|
||||
except Exception as exc:
|
||||
print(f"Unsuccessful attempt to change password for {form('username')}: {exc=}")
|
||||
return error(str(exc))
|
||||
|
||||
print("Password successfully changed for: {}"
|
||||
.format(form('username')))
|
||||
|
|
Loading…
Reference in New Issue
Block a user