projects
/
mirror
/
userdir-ldap.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9c3400f
)
fix not-array-value-but-multiple-values check
author
Peter Palfrader
<peter@palfrader.org>
Mon, 2 Aug 2010 21:28:31 +0000
(21:28 +0000)
committer
Peter Palfrader
<peter@palfrader.org>
Mon, 2 Aug 2010 21:28:48 +0000
(21:28 +0000)
UDLdap.py
patch
|
blob
|
history
diff --git
a/UDLdap.py
b/UDLdap.py
index
4f83137
..
6494c0d
100644
(file)
--- a/
UDLdap.py
+++ b/
UDLdap.py
@@
-30,11
+30,12
@@
class Account:
if key in self.attributes:
if key in self.array_values:
return self.attributes[key]
if key in self.attributes:
if key in self.array_values:
return self.attributes[key]
- elif key in self.int_values:
- if len(self.attributes[key]) == 1:
- return int(self.attributes[key][0])
- else:
- raise ValueError, 'non-array value has not exactly one value'
+
+ if not len(self.attributes[key]) == 1:
+ raise ValueError, 'non-array value has not exactly one value'
+
+ if key in self.int_values:
+ return int(self.attributes[key][0])
else:
return self.attributes[key][0]
elif key in self.defaults:
else:
return self.attributes[key][0]
elif key in self.defaults: