Commit 6b74765a authored by Daniel STAN's avatar Daniel STAN

utilise un context pour modifier l'adh

parent 069ab9cc
......@@ -50,8 +50,9 @@ class Ticket(object):
login = adh['uid'][0].value
try:
value = gen_password()
adh['userPassword'] = [crans_utils.hash_password(value).decode('ascii')]
adh.save()
with adh:
adh['userPassword'] = [crans_utils.hash_password(value).decode('ascii')]
adh.save()
except EnvironmentError:
print("Impossible de changer le mot de passe de %s" % login)
exit(2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment