backends: convert ldap attribute names to str

This commit is contained in:
Benjamin Dauvergne 2013-12-06 00:16:11 +01:00
parent 600ebffa2f
commit e3d075042f
1 changed files with 2 additions and 0 deletions

View File

@ -579,6 +579,7 @@ class LDAPBackend():
attribute_map = results[0][1]
# add mandatory attributes
for key, mandatory_values in mandatory_attributes_values.iteritems():
key = str(key)
old = attribute_map.setdefault(key, [])
new = set(old) | set(mandatory_values)
attribute_map[key] = list(new)
@ -586,6 +587,7 @@ class LDAPBackend():
for from_attribute, to_attribute in attribute_mappings:
if from_attribute not in attribute_map:
continue
to_attribute = str(to_attribute)
old = attribute_map.setdefault(to_attribute, [])
new = set(old) | set(attribute_map[from_attribute])
attribute_map[to_attribute] = list(new)