python3: greedy retrieval of ldap mapped-attributes' value
This commit is contained in:
parent
5cda45d69f
commit
a93bcee205
|
@ -1209,10 +1209,10 @@ class LDAPBackend(object):
|
|||
new_attributes = {}
|
||||
for key in attributes:
|
||||
try:
|
||||
new_attributes[key.lower()] = map(lambda x: force_text(x, encoding), attributes[key])
|
||||
new_attributes[key.lower()] = list(map(lambda x: force_text(x, encoding), attributes[key]))
|
||||
except UnicodeDecodeError:
|
||||
log.debug('unable to decode attribute %r as UTF-8, converting to base64', key)
|
||||
new_attributes[key.lower()] = map(base64.b64encode, attributes[key])
|
||||
new_attributes[key.lower()] = list(map(base64.b64encode, attributes[key]))
|
||||
return new_attributes
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue