MPIB / Lagerregal

Super awesome inventory System for electronic devices
Other
24 stars 10 forks source link

WIP: Replace ldap import script #353

Closed xi closed 3 years ago

xi commented 5 years ago

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:

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

octomike commented 5 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.

xi commented 5 years ago

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?

octomike commented 5 years ago

When does populate_user() fire exactly? Just on authentication?

Synchronizing all users needs to be done on a regular basis.