baruwaproject / baruwa2

Baruwa 2.0
http://www.baruwa.org
GNU General Public License v3.0
21 stars 9 forks source link

[bug] Logging in through LDAP if user has no e-mail address causes '500' error #129

Closed rmoesbergen closed 6 years ago

rmoesbergen commented 6 years ago

When logging in on the baruwa web interface with an LDAP user without an email address filled in, the following error occurs:

Module baruwa.controllers.accounts:176 in loggedin

user, local_part, domain, domains, self.identity) Module baruwa.lib.db:857 in user_address_update for mailattr in ldapattributes[attr]: KeyError: 'mail'

This is with and Active Directory LDAP server. It seems that when a user doesn't have the field 'Email Address' filled in, the attribute 'mail' does not exist at all and causes this error. Workaround is of course to fill in the email address field, but it would be nicer/better to not crash when this happens.

akissa commented 6 years ago

Fixed in development branch