Discard the (weird) ldap accounts that have no uid

This commit is contained in:
Martin Pépin 2020-09-02 21:34:21 +02:00
parent 576d43f44d
commit b1fd6e6021
No known key found for this signature in database
GPG key ID: E7520278B1774448

View file

@ -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)