username doesn't necessarily need to be in slot 0

check for existence in whole array instead
This commit is contained in:
Ruben van Staveren 2015-03-16 20:03:45 +01:00
parent 8a12fbbce8
commit 6e510935c6

View File

@ -227,7 +227,7 @@ def groups(username, **kwargs):
else:
return False
for _, entry in search_results:
if entry['memberUid'][0] == username:
if username in entry['memberUid']:
group_list.append(entry['cn'][0])
log.debug('User {0} is a member of groups: {1}'.format(username, group_list))
return group_list