LDAP sync fails on first login afer configuring LDAP
On first login after configuring LDAP authentication, LDAP sync for the person fails:
File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/ldap/util/ldap_sync.py", line 206, in ldap_sync_user_on_login
person = ldap_sync_from_user(user, ldap_user.dn, ldap_user.attrs.data)
File "/usr/lib/python3.9/contextlib.py", line 79, in inner
return func(*args, **kwds)
File "/usr/local/lib/python3.9/dist-packages/aleksis/apps/ldap/util/ldap_sync.py", line 263, in ldap_sync_from_user
raise KeyError(f"No matching fields found for {dn}")
Firstly, LDAP synchronisaiton should not be enabled by default. Secondly, it should fail gracefully, and tell what is going wrong.