Closed xi closed 3 years ago
Import users from LDAP. That is not necessary because django-auth-ldap creates users on demand.
I guess the reason is that most of the users we need in Lagerregal (lend device to X) never actually authenticate.
I see. I forgot we also use the Lageruser model for people we lend things to.
Still I think most of this script can be replaced. The populate_user()
example looks promising. I could imagine that it is slow though because it would make individual requests for every user. Is performance a concern?
When does populate_user()
fire exactly? Just on authentication?
Synchronizing all users needs to be done on a regular basis.
I was looking at
ldapimport.py
and couldn't really figure out why it is there. As far as I could see, it does three things:user.main_department
is also included inuser.departments
.I think the better approach for most of this is using the
populate_user
signal. This branch contains a rough implementation. It is hard to say whether it works correctly without the rest of the LDAP config (which is not contained in this repo).