From 4af481aeef19b5c7002d9cb5f80c336320fedc06 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Mon, 26 Aug 2013 13:33:51 +0200 Subject: [PATCH] host est unique et check_uniqness a la creation --- attributs.py | 1 + objets.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/attributs.py b/attributs.py index 3f01752..f023bd1 100644 --- a/attributs.py +++ b/attributs.py @@ -628,6 +628,7 @@ class dnsAttr(Attr): @crans_attribute class host(dnsAttr): singlevalue = True + unique = True optional = False hname = legend = u"Nom d'hôte" can_modify = [parent, nounou, cableur] diff --git a/objets.py b/objets.py index dff89ee..ecf9b3f 100644 --- a/objets.py +++ b/objets.py @@ -212,6 +212,10 @@ class CransLdapObject(object): self.history_add(login, u"Inscription") + for attr in self.attrs.keys(): + for attribut in self[attr]: + attribut.check_uniqueness([]) + # Création de la requête LDAP modlist = addModlist(self._modifs.to_ldif()) # Requête LDAP de création de l'objet