diff options
| author | Holger Brunn <hbrunn@therp.nl> | 2019-11-25 08:50:09 +0000 |
|---|---|---|
| committer | Martin Trigaux <mat@odoo.com> | 2019-11-25 08:50:09 +0000 |
| commit | 67848457d0049870b8dacc33637a1d89d4c3dfa1 (patch) | |
| tree | 2bbc93a0a7eaffb82a0b23475519eb5c366077b7 /addons/auth_ldap | |
| parent | 715c136cd20c9e9969eeb45db993917defb8c0b2 (diff) | |
[FIX] auth_ldap: encode python ldap's output as utf8
Non-ascii characters in LDAP don't cause a python unicode string in
returned ldap entries, this commit fixes this.
Before this commit, further string operations on ldap values with
non-ascii characters fail.
closes odoo/odoo#40761
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Diffstat (limited to 'addons/auth_ldap')
| -rw-r--r-- | addons/auth_ldap/models/res_company_ldap.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/auth_ldap/models/res_company_ldap.py b/addons/auth_ldap/models/res_company_ldap.py index 7c809f3aaeb..0c49def3e1a 100644 --- a/addons/auth_ldap/models/res_company_ldap.py +++ b/addons/auth_ldap/models/res_company_ldap.py @@ -167,7 +167,7 @@ class CompanyLDAP(models.Model): """ return { - 'name': ldap_entry[1]['cn'][0], + 'name': tools.ustr(ldap_entry[1]['cn'][0]), 'login': login, 'company_id': conf['company'][0] } |
