Plus d'infos sur les doublons dans une base ldap
This commit is contained in:
parent
4a3434847e
commit
0fb2cf4416
1 changed files with 4 additions and 1 deletions
|
@ -680,8 +680,11 @@ class CransLdapObject(object):
|
||||||
try:
|
try:
|
||||||
for attribut in attrs_before_verif:
|
for attribut in attrs_before_verif:
|
||||||
# Vérification que (attr, value) est localement unique
|
# Vérification que (attr, value) est localement unique
|
||||||
|
# Il vaut mieux le vérifier ici, car l'erreur que LDAP
|
||||||
|
# lève n'est pas très claire. (mais il est clair qu'il ne
|
||||||
|
# tolère pas les doublons dans un objet)
|
||||||
if attrs_before_verif.count(attribut) > 1:
|
if attrs_before_verif.count(attribut) > 1:
|
||||||
raise ValueError("%s en double\n(%s)" % (attribut.legend if attribut.legend else attr, attribut))
|
raise ValueError("%r en double\n(%r)" % (attribut.legend if attribut.legend else attr, attribut))
|
||||||
|
|
||||||
# On lock les nouvelles valeurs globalement unique
|
# On lock les nouvelles valeurs globalement unique
|
||||||
if not no_uniq_lock and attribut.unique and not attribut in self._modifs.get(attr, []) and not attribut in attribut.unique_exclue:
|
if not no_uniq_lock and attribut.unique and not attribut in self._modifs.get(attr, []) and not attribut in attribut.unique_exclue:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue