Commit 24721ddc authored by Valentin Samir's avatar Valentin Samir

[objets] Libération du lock en cas d'opération involutive sur un attribut non concurrent

Par exemple :
   adh['solde'][0]+=2 # acquisition du lock
   adh['solde'][0]-=2 # libération du lock
parent 177134b6
......@@ -611,6 +611,9 @@ class CransLdapObject(object):
for attribut in self._modifs.get(attr, []):
if attribut.unique and not attribut in attrs_before_verif and not attribut in attribut.unique_exclue:
self.conn.lockholder.removelock(attr, str(attribut), self.lockId)
# Si on remet la valeur antérieure au lock, on le libère
if not attribut.concurent and self._modifs.get(attr, []) != self.attrs.get(attr, []) and attrs_before_verif == self.attrs.get(attr, []):
self.conn.lockholder.removelock("dn", "%s_%s" % (self.dn.replace('=', '-').replace(',','_'), attr), self.lockId)
# On met à jour self._modifs avec les nouvelles valeurs
self._modifs[attr] = attrs_before_verif
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