Antagonisme entre un attribut et sa valeur textuelle
This commit is contained in:
parent
d47b2febc7
commit
cc0f6e0a91
2 changed files with 5 additions and 5 deletions
|
@ -277,7 +277,7 @@ class nom(Attr):
|
||||||
|
|
||||||
def parse_value(self, nom):
|
def parse_value(self, nom):
|
||||||
if self.parent != None:
|
if self.parent != None:
|
||||||
if u'club' in self.parent['objectClass']:
|
if u'club' in [str(o) for o in self.parent['objectClass']]:
|
||||||
self.value = validate_name(nom,"0123456789\[\]")
|
self.value = validate_name(nom,"0123456789\[\]")
|
||||||
else:
|
else:
|
||||||
self.value = validate_name(nom)
|
self.value = validate_name(nom)
|
||||||
|
@ -449,7 +449,7 @@ class chbre(Attr):
|
||||||
|
|
||||||
def parse_value(self, chambre):
|
def parse_value(self, chambre):
|
||||||
if self.parent != None:
|
if self.parent != None:
|
||||||
if u'club' in self.parent['objectClass']:
|
if u'club' in [str(o) for o in self.parent['objectClass']]:
|
||||||
if chambre in annuaires_pg.locaux_clubs():
|
if chambre in annuaires_pg.locaux_clubs():
|
||||||
self.value = chambre
|
self.value = chambre
|
||||||
return
|
return
|
||||||
|
|
|
@ -308,7 +308,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject, object):
|
||||||
|
|
||||||
def newAdherent(self, ldif):
|
def newAdherent(self, ldif):
|
||||||
"""Crée un nouvel adhérent"""
|
"""Crée un nouvel adhérent"""
|
||||||
aid = ldif.setdefault('aid', [ self._find_id('aid') ])
|
aid = ldif.setdefault('aid', [ str(self._find_id('aid')) ])
|
||||||
ldif['objectClass'] = ['adherent']
|
ldif['objectClass'] = ['adherent']
|
||||||
adherent = self._create_entity('aid=%s,%s' % (aid[0], base_dn), ldif)
|
adherent = self._create_entity('aid=%s,%s' % (aid[0], base_dn), ldif)
|
||||||
if adherent.may_be(created, self.droits):
|
if adherent.may_be(created, self.droits):
|
||||||
|
@ -318,7 +318,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject, object):
|
||||||
|
|
||||||
def newClub(self, ldif):
|
def newClub(self, ldif):
|
||||||
"""Crée un nouveau club"""
|
"""Crée un nouveau club"""
|
||||||
cid = ldif.setdefault('cid', [ self._find_id('cid') ])
|
cid = ldif.setdefault('cid', [ str(self._find_id('cid')) ])
|
||||||
ldif['objectClass'] = ['club']
|
ldif['objectClass'] = ['club']
|
||||||
club = self._create_entity('cid=%s,%s' % (cid[0], base_dn), ldif)
|
club = self._create_entity('cid=%s,%s' % (cid[0], base_dn), ldif)
|
||||||
if club.may_be(created, self.droits):
|
if club.may_be(created, self.droits):
|
||||||
|
@ -956,7 +956,7 @@ class adherent(proprio):
|
||||||
u"""Renvoie le nom du compte crans. S'il n'existe pas, et que uid
|
u"""Renvoie le nom du compte crans. S'il n'existe pas, et que uid
|
||||||
est précisé, le crée."""
|
est précisé, le crée."""
|
||||||
|
|
||||||
if u'posixAccount' in self.attrs['objectClass']:
|
if u'posixAccount' in [str(o) for o in self.attrs['objectClass']]:
|
||||||
return self.attrs['uid'][0]
|
return self.attrs['uid'][0]
|
||||||
|
|
||||||
elif login:
|
elif login:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue