exclude empty strings from ldap results

The uid attribute in a LDAP's entry cannot be an empty string. We need
to get an actual identifier.
This commit is contained in:
Martin Pépin 2017-04-01 22:07:32 +01:00
parent c3d740ade0
commit f6d43dffa1
2 changed files with 2 additions and 2 deletions

View file

@ -77,7 +77,7 @@ def autocomplete(request):
queries['clippers'] = [
Clipper(entry.uid.value, entry.cn.value)
for entry in entries
if entry.uid.value is not None
if entry.uid.value
and entry.uid.value not in usernames
]

View file

@ -96,7 +96,7 @@ def account_create(request):
queries['clippers'] = [
Clipper(entry.uid.value, entry.cn.value)
for entry in entries
if entry.uid.value is not None
if entry.uid.value
and entry.uid.value not in usernames
]