Commits

Zhang Huangbin committed 00191ea

Delete attribute while value is empty.

Comments (0)

Files changed (1)

libs/ldaplib/user.py

                 mod_attrs += [ ( ldap.MOD_REPLACE, 'mailQuota', str(int(mailQuota) * 1024 * 1024) ) ]
 
             # Get telephoneNumber.
-            employeeNumber = data.get('employeeNumber', 'None')
-            mod_attrs += ldaputils.getSingleModAttr(attr='employeeNumber', value=employeeNumber, default='None')
+            employeeNumber = data.get('employeeNumber', None)
+            mod_attrs += ldaputils.getSingleModAttr(attr='employeeNumber', value=employeeNumber, default=None)
 
             telephoneNumber = data.get('telephoneNumber', [])
             if telephoneNumber != [] and telephoneNumber != [u''] and telephoneNumber != []: