-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Exception raised when AD user has no email #19
Comments
Yep, I agree that passing a blank string is a better idea for those fields.
Could you create a PR and I can do some testing on OpenLDAP also.
Thanks Alan
|
alandmoore
added a commit
to alandmoore/django_auth_ldap3
that referenced
this issue
May 2, 2016
When LDAP has empty values for an attribute, default to an empty string rather than None. This fixes issue sjkingo#19.
sjkingo
pushed a commit
that referenced
this issue
May 5, 2016
When LDAP has empty values for an attribute, default to an empty string rather than None. This fixes issue #19.
Version 0.9.6 released on PyPi that incorporates the changes from #20. Thanks Alan |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
If no email address is specified in AD, django will throw an exception on login because the
User
model doesn't allow an email value ofNone
.In line 34 of backends.py, any missing attributes are filled in with
None
as a value. The default django User model allows blank for first_name, last_name, and email, so I'm wondering if it would be better to default missing attributes to an empty string.There are legitimate cases where an AD user may not have a first name, last name, or email address specified, so it seems like the right thing to just pass that empty field on to the
User
object.Thoughts?
The text was updated successfully, but these errors were encountered: