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:
|
try:
|
||||||
ldap_change_password(form('username'),
|
ldap_change_password(form('username'),
|
||||||
form('old-password'), form('new-password'))
|
form('old-password'), form('new-password'))
|
||||||
except Error as e:
|
except Exception as exc:
|
||||||
print("Unsuccessful attemp to change password for {}: {}"
|
print(f"Unsuccessful attempt to change password for {form('username')}: {exc=}")
|
||||||
.format(form('username'), str(e)))
|
return error(str(exc))
|
||||||
return error(str(e))
|
|
||||||
|
|
||||||
print("Password successfully changed for: {}"
|
print("Password successfully changed for: {}"
|
||||||
.format(form('username')))
|
.format(form('username')))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user