X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=UDLdap.py;h=9f8a0fd7375a05f88c9f0cfe12ecb558d42a290f;hb=6171f9991eb458001488b215a09d34231d5890d4;hp=3dc2b742fec2f3c06eb81bab99bda6cb176b0a83;hpb=a10f6e27cfde5e7cf7fba28f00f73b8d5f52aeb0;p=mirror%2Fuserdir-ldap.git diff --git a/UDLdap.py b/UDLdap.py index 3dc2b74..9f8a0fd 100644 --- a/UDLdap.py +++ b/UDLdap.py @@ -31,7 +31,10 @@ class Account: if key in self.array_values: return self.attributes[key] elif key in self.int_values: - return int(self.attributes[key][0]) + if len(self.attributes[key]) == 1: + return int(self.attributes[key][0]) + else: + raise ValueError, 'non-array value has not exactly one value' else: return self.attributes[key][0] elif key in self.defaults: