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 9cdf064005
commit a793e9a2e7
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

@ -95,7 +95,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
]