Adding items to the set needs to be lower case to prevent duplicates.

This function was assuming that the target list was all lower-case so the
set could end up with duplicate values which would get kicked out by LDAP.

433680
This commit is contained in:
Rob Crittenden 2008-03-10 11:36:04 -04:00
parent 5547ed320a
commit a39f38f65b

View File

@ -2089,4 +2089,4 @@ def ldap_search_escape(match):
def uniq_list(x):
"""Return a unique list, preserving order and ignoring case"""
set = {}
return [set.setdefault(e,e) for e in x if e.lower() not in set]
return [set.setdefault(e.lower(),e.lower()) for e in x if e.lower() not in set]