[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
This commit is contained in:
parent
177134b6c9
commit
24721ddc98
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue