diff --git a/objets.py b/objets.py index d0cf589..0a4dfd8 100644 --- a/objets.py +++ b/objets.py @@ -533,6 +533,8 @@ class CransLdapObject(object): try: for attribut in attrs_before_verif: 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) locked.append((attr, str(attribut), self.lockId)) except ldap_locks.LockError: