projects
/
matthijs
/
upstream
/
django-ldapdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add some tests for different field types
[matthijs/upstream/django-ldapdb.git]
/
ldapdb
/
__init__.py
diff --git
a/ldapdb/__init__.py
b/ldapdb/__init__.py
index 4b0a6d54379abaf9dbb55d1037426fe0a2148d32..d1dcc47d05012a4260431dcabc6b2b3ffe306068 100644
(file)
--- a/
ldapdb/__init__.py
+++ b/
ldapdb/__init__.py
@@
-24,6
+24,7
@@
from django.conf import settings
from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations
def convert(field, value, func):
from django.db.backends import BaseDatabaseFeatures, BaseDatabaseOperations
def convert(field, value, func):
+ # FIXME : we should not reference the attribute name!
if not value or field == 'jpegPhoto':
return value
elif isinstance(value, int):
if not value or field == 'jpegPhoto':
return value
elif isinstance(value, int):
@@
-99,10
+100,7
@@
class LdapConnection(object):
output = []
for dn, attrs in results:
for field in attrs:
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))
+ attrs[field] = convert(field, attrs[field], lambda x: x.decode(self.charset))
output.append((dn.decode(self.charset), attrs))
return output
output.append((dn.decode(self.charset), attrs))
return output