[FIX] auth_ldap: fix authentication with special chars

encode the filter in utf-8

This prevents a UnicodeDecode error in python-ldap when the
filter contains non ascii characters.

opw-682783
closes #10899
closes #12710
This commit is contained in:
Alexandre Fayolle 2016-02-12 11:52:47 +01:00 committed by Denis Ledoux
parent 4ab34d4156
commit 94f58d647c
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class CompanyLDAP(osv.osv):
_logger.warning('Could not format LDAP filter. Your filter should contain one \'%s\'.')
return False
try:
results = self.query(conf, filter)
results = self.query(conf, filter.encode('utf-8'))
# Get rid of (None, attrs) for searchResultReference replies
results = [i for i in results if i[0]]