Merge branch 'kerl/discard_weird_ldap_users' into 'master'

Ignore les comptes LDAP bizarres (e.g. root)

See merge request klub-dev-ens/gestioCOF!453
This commit is contained in:
Ludovic Stephan 2020-09-02 23:44:33 +02:00
commit a9b6bc65a2

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)