On attrify également lorsque la valeur est appelé avec .get(...)
This commit is contained in:
parent
db32b1d65a
commit
0c0338719c
2 changed files with 8 additions and 2 deletions
|
@ -102,10 +102,16 @@ class AttrsDict(dict) :
|
|||
values = super(AttrsDict, self).__getitem__(attr)
|
||||
if not isinstance(values, list):
|
||||
values = [ values ]
|
||||
values = [ attrify(unicode(val, 'utf-8'), attr, self._ldif, self._conn, self._check_ctxt) for val in values]
|
||||
values = [ attrify(unicode(val, 'utf-8'), attr, self._ldif, self._conn, self._check_ctxt) for val in values if not isinstance(val, Attr)]
|
||||
self[attr] = values
|
||||
return values
|
||||
|
||||
def get(self, value, default_value):
|
||||
try:
|
||||
return self[value]
|
||||
except KeyError:
|
||||
return default_value
|
||||
|
||||
class Attr(object):
|
||||
"""Objet représentant un attribut.
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ class lc_ldap(ldap.ldapobject.LDAPObject, object):
|
|||
uldif['objectClass'] = [u'machineWifi']
|
||||
assert isinstance(owner, adherent) or isinstance(owner, club)
|
||||
|
||||
elif realm in ["fil", "fil-v6", "personnel-ens"]:
|
||||
elif realm in ["fil-adherents", "fil-v6", "personnel-ens"]:
|
||||
uldif['objectClass'] = [u'machineFixe']
|
||||
assert isinstance(owner, adherent) or isinstance(owner, club)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue