This commit is contained in:
parent
f541630a63
commit
b80cc3b3b6
1 changed files with 2 additions and 2 deletions
|
@ -24,7 +24,7 @@ DEFAULT_ENCODING = 'utf-8'
|
|||
def decode_ldap_value(value, encoding='utf-8'):
|
||||
""" Decoding LDAP attribute values helper """
|
||||
if isinstance(value, bytes):
|
||||
return value.decode_ldap_value(encoding)
|
||||
return value.decode(encoding)
|
||||
if isinstance(value, list):
|
||||
return [decode_ldap_value(v) for v in value]
|
||||
if isinstance(value, dict):
|
||||
|
@ -38,7 +38,7 @@ def decode_ldap_value(value, encoding='utf-8'):
|
|||
def encode_ldap_value(value, encoding='utf-8'):
|
||||
""" Encoding LDAP attribute values helper """
|
||||
if isinstance(value, str):
|
||||
return value.encode_ldap_value(encoding)
|
||||
return value.encode(encoding)
|
||||
if isinstance(value, list):
|
||||
return [encode_ldap_value(v) for v in value]
|
||||
if isinstance(value, dict):
|
||||
|
|
Loading…
Reference in a new issue