0001-WIP-ldap_backend-fix-encoding-errors-during-user-syn.patch
src/authentic2/backends/ldap_backend.py | ||
---|---|---|
300 | 300 |
_TO_LOWERCASE = ('fname_field', 'lname_field', 'email_field', 'attributes', |
301 | 301 |
'mandatory_attributes_values') |
302 | 302 |
_VALID_CONFIG_KEYS = list(set(_REQUIRED).union(set(_DEFAULTS))) |
303 |
_DN_SUBELEMENTS = ('basedn', 'user_basedn', 'group_basedn', 'user_dn') |
|
303 | 304 | |
304 | 305 |
@classmethod |
305 | 306 |
@to_list |
... | ... | |
319 | 320 |
# First get our configuration into a standard format |
320 | 321 |
for block in blocks: |
321 | 322 |
cls.update_default(block) |
323 |
for dn_subelement in cls._DN_SUBELEMENTS: |
|
324 |
if isinstance(block.get(dn_subelement), unicode): |
|
325 |
block[dn_subelement] = block[dn_subelement].encode('utf-8') |
|
322 | 326 |
log.debug('got config %r', blocks) |
323 | 327 |
return blocks |
324 | 328 | |
325 |
- |