-
Notifications
You must be signed in to change notification settings - Fork 1
support ldap3 #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support ldap3 #27
Conversation
djangowind/auth.py
Outdated
| if not user.last_name or not user.first_name: | ||
| try: | ||
| r = ldap_lookup(user.username) | ||
| r = self.ldap_lookup(user.username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this still result in an ImportError exception? self.ldap_lookup will just be undefined here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Forgot the default implementation...
djangowind/auth.py
Outdated
| if not user.email: | ||
| user.email = user.username + "@columbia.edu" | ||
| if not user.last_name or not user.first_name: | ||
| try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. And, can this try/catch be removed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
python-ldap doesn't work with python3 and is apparently stalled out.
This adds transparent support for ldap3, which is python3 compatible and will let us move forward on that.
As implemented here, if the
ldap3library is importable, it uses that. Otherwise, it falls back topython-ldap.My suggested plan is to get this out in a new release. Then we can go app by app adding
ldap3. Once all of our applications are using that, we can remove the old python-ldap support.some additional notes: