From b1fd6e6021a0731ff65f65ba392168179f5215b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Wed, 2 Sep 2020 21:34:21 +0200 Subject: [PATCH] Discard the (weird) ldap accounts that have no uid --- shared/autocomplete.py | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/autocomplete.py b/shared/autocomplete.py index 971a8dfb..75c6d814 100644 --- a/shared/autocomplete.py +++ b/shared/autocomplete.py @@ -182,6 +182,7 @@ class LDAPSearch(SearchUnit): mail=attrs["mail"][0].decode("utf-8"), ) for (_, attrs) in res + if "uid" in attrs # Hack to discard weird accounts like root ] except ldap.LDAPError as err: django_logger.error("An LDAP error occurred", exc_info=err)