utilise un context pour modifier l'adh
This commit is contained in:
parent
069ab9cc66
commit
6b74765a55
1 changed files with 3 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue