'User' object has no attribute 'ldap_username' error when attempting to change password #3059

Closed
opened 2025-12-29 18:25:13 +01:00 by adam · 2 comments
Owner

Originally created by @NielsH on GitHub (Dec 10, 2019).

Environment

  • Python version: 3.5.3
  • NetBox version: 2.6.8

Hello!

I'm a new Netbox user and just installed netbox 2.6.8. Everything seems to work except 1 thing:
When I go to /user/password/ I get the following error:

There was a problem with your request. Please contact an administrator.

The complete exception is provided below:

<class 'AttributeError'>

'User' object has no attribute 'ldap_username'
If further assistance is required, please post to the NetBox mailing list.

Does anyone know what could cause this?

Cheers!
Niels

Originally created by @NielsH on GitHub (Dec 10, 2019). <!-- NOTE: This form is only for reproducible bugs. If you need assistance with NetBox installation, or if you have a general question, DO NOT open an issue. Instead, post to our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please describe the environment in which you are running NetBox. Be sure that you are running an unmodified instance of the latest stable release before submitting a bug report. --> ### Environment * Python version: 3.5.3 * NetBox version: 2.6.8 <!-- Describe in detail the exact steps that someone else can take to reproduce this bug using the current stable release of NetBox (or the current beta release where applicable). Begin with the creation of any necessary database objects and call out every operation being performed explicitly. If reporting a bug in the REST API, be sure to reconstruct the raw HTTP request(s) being made: Don't rely on a wrapper like pynetbox. --> Hello! I'm a new Netbox user and just installed netbox 2.6.8. Everything seems to work except 1 thing: When I go to `/user/password/` I get the following error: ``` There was a problem with your request. Please contact an administrator. The complete exception is provided below: <class 'AttributeError'> 'User' object has no attribute 'ldap_username' If further assistance is required, please post to the NetBox mailing list. ``` Does anyone know what could cause this? Cheers! Niels
adam closed this issue 2025-12-29 18:25:14 +01:00
Author
Owner

@hSaria commented on GitHub (Dec 10, 2019):

You'll want to change the bug report to conform with the provided templates, or the maintainers will close the ticket.

This is a bug introduced in b1761f7856 (diff-73376e8b4737afa086136adcf5270ae6R99).

Just gotta replace in netbox/users/views.py

- if getattr(request.user, 'ldap_username'):
+ if getattr(request.user, 'ldap_username', None):
@hSaria commented on GitHub (Dec 10, 2019): You'll want to change the bug report to conform with the provided templates, or the maintainers will close the ticket. This is a bug introduced in https://github.com/netbox-community/netbox/commit/b1761f78567bc5137771128557d851f37efa385b#diff-73376e8b4737afa086136adcf5270ae6R99. Just gotta replace in `netbox/users/views.py` ```python - if getattr(request.user, 'ldap_username'): + if getattr(request.user, 'ldap_username', None): ```
Author
Owner

@jeremystretch commented on GitHub (Dec 10, 2019):

Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided here. For general discussion, questions, or assistance with installation issues, please post to our mailing list instead.

@jeremystretch commented on GitHub (Dec 10, 2019): Thank you for your interest in NetBox. GitHub issues are intended for reporting reproducible bugs and requesting features, and must be submitted using one of the templates provided [here](https://github.com/digitalocean/netbox/issues/new/choose). For general discussion, questions, or assistance with installation issues, please post to our [mailing list](https://groups.google.com/forum/#!forum/netbox-discuss) instead.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3059