server/ldaputils.py
changeset 8917 685b93559e33
parent 8906 ed35d984ff28
child 8918 43fd866e8f8a
--- a/server/ldaputils.py	Wed Apr 24 15:37:43 2013 +0200
+++ b/server/ldaputils.py	Wed Apr 24 14:00:52 2013 +0200
@@ -342,10 +342,11 @@
                     value = utils.crypt_password(value)
                 itemdict[key] = Binary(value)
             else:
-                for i, val in enumerate(value):
-                    value[i] = unicode(val, 'utf-8', 'replace')
-                if isinstance(value, list) and len(value) == 1:
+                value = [unicode(val, 'utf-8', 'replace') for val in value]
+                if len(value) == 1:
                     itemdict[key] = value = value[0]
+                else:
+                    itemdict[key] = value
         return itemdict
 
     def _process_no_such_object(self, session, dn):