[FIX] users_ldap: get rid of results without DN for searchResultReference, courtesy...
authorMartin Trigaux <mat@openerp.com>
Mon, 27 Jan 2014 13:36:44 +0000 (14:36 +0100)
committerMartin Trigaux <mat@openerp.com>
Mon, 27 Jan 2014 13:36:44 +0000 (14:36 +0100)
lp bug: https://launchpad.net/bugs/983123 fixed

bzr revid: mat@openerp.com-20140127133644-mqyz0s4aqzv9exkd

addons/users_ldap/users_ldap.py

index 1d0c1e3..2df7754 100644 (file)
@@ -98,6 +98,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)