Antagonisme entre un attribut et sa valeur textuelle

This commit is contained in:
Valentin Samir 2013-05-14 18:00:00 +02:00
parent d47b2febc7
commit cc0f6e0a91
2 changed files with 5 additions and 5 deletions

View file

@ -308,7 +308,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject, object):
def newAdherent(self, ldif):
"""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']
adherent = self._create_entity('aid=%s,%s' % (aid[0], base_dn), ldif)
if adherent.may_be(created, self.droits):
@ -318,7 +318,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject, object):
def newClub(self, ldif):
"""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']
club = self._create_entity('cid=%s,%s' % (cid[0], base_dn), ldif)
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
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]
elif login: