[objets] En cas d'ajout de lock hors contexte, on affiche un warning
This commit is contained in:
parent
06ea17715b
commit
d8b1e5da51
1 changed files with 2 additions and 0 deletions
|
@ -533,6 +533,8 @@ class CransLdapObject(object):
|
||||||
try:
|
try:
|
||||||
for attribut in attrs_before_verif:
|
for attribut in attrs_before_verif:
|
||||||
if attribut.unique and not attribut in self._modifs.get(attr, []):
|
if attribut.unique and not attribut in self._modifs.get(attr, []):
|
||||||
|
if not self.in_context:
|
||||||
|
cranslib.deprecated.usage("Des locks ne devrait être ajoutés que dans un context manager", level=2)
|
||||||
self.conn.lockholder.addlock(attr, str(attribut), self.lockId)
|
self.conn.lockholder.addlock(attr, str(attribut), self.lockId)
|
||||||
locked.append((attr, str(attribut), self.lockId))
|
locked.append((attr, str(attribut), self.lockId))
|
||||||
except ldap_locks.LockError:
|
except ldap_locks.LockError:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue