diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-04-08 14:06:38 (GMT) |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-04-08 14:06:38 (GMT) |
commit | b1fd2589c6a80cd834d5e5d8b5512021a83cc615 (patch) | |
tree | a4ea593c06d230cb8e4d2d02693ba6ff32ba8f0c | |
parent | b43779a966d238a3ebf657aa0a9f36d7ee4a339f (diff) | |
download | pykolab-b1fd2589c6a80cd834d5e5d8b5512021a83cc615.tar.gz |
Only make integers become a string on modify
-rw-r--r-- | pykolab/auth/ldap/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py index 2213f39..da16560 100644 --- a/pykolab/auth/ldap/__init__.py +++ b/pykolab/auth/ldap/__init__.py @@ -884,7 +884,10 @@ class LDAP(object): mode = ldap.MOD_ADD try: - self.ldap.modify(user['dn'], [(mode, attribute, '%s' % (value))]) + if isinstance(value, int): + value = (str)(value) + + self.ldap.modify(user['dn'], [(mode, attribute, value)]) except ldap.LDAPError, e: log.warning( _("LDAP modification of attribute %s for %s to value " + \ |