Skip to content
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

Closed
alandmoore opened this issue Apr 28, 2016 · 2 comments
Closed

Exception raised when AD user has no email #19

alandmoore opened this issue Apr 28, 2016 · 2 comments

Comments

@alandmoore
Copy link
Contributor

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 of None.

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?

@sjkingo
Copy link
Owner

sjkingo commented Apr 28, 2016 via email

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.
@sjkingo
Copy link
Owner

sjkingo commented May 5, 2016

Version 0.9.6 released on PyPi that incorporates the changes from #20.

Thanks Alan

@sjkingo sjkingo closed this as completed May 5, 2016
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants