[MERGE] [FIX] users_ldap: forward port of rev 7301 from 6.1, get rid of results without DN for searchResultReference

bzr revid: mat@openerp.com-20140127142836-pvta002gk1ckfzkh
This commit is contained in:
Martin Trigaux 2014-01-27 15:28:36 +01:00
commit 29b03f073d
1 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,9 @@ class CompanyLDAP(osv.osv):
filter = filter_format(conf['ldap_filter'], (login,))
try:
results = self.query(conf, filter)
# Get rid of (None, attrs) for searchResultReference replies
results = [i for i in results if i[0]]
if results and len(results) == 1:
dn = results[0][0]
conn = self.connect(conf)