From: jlaine Date: Tue, 1 Sep 2009 15:32:33 +0000 (+0000) Subject: fix DN encoding in search_s X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fdjango-ldapdb.git;a=commitdiff_plain;h=0be5396f6fbb66545d009e95b332b098803260b5 fix DN encoding in search_s git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@540 e071eeec-0327-468d-9b6a-08194a12b294 --- diff --git a/ldapdb/__init__.py b/ldapdb/__init__.py index c8c56ed..c622eb3 100644 --- a/ldapdb/__init__.py +++ b/ldapdb/__init__.py @@ -62,13 +62,15 @@ class LdapConnection(object): def search_s(self, base, scope, filterstr, attrlist): results = self.connection.search_s(base, scope, filterstr.encode(self.charset), attrlist) + output = [] for dn, attrs in results: for field in attrs: if field == "member" or field == "memberUid": attrs[field] = convert(field, attrs[field], lambda x: x.decode(self.charset)) else: attrs[field] = convert(field, attrs[field][0], lambda x: x.decode(self.charset)) - return results + output.append((dn.decode(self.charset), attrs)) + return output # FIXME: is this the right place to initialize the LDAP connection? connection = LdapConnection(settings.LDAPDB_SERVER_URI,