Skip to content

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

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

Closed
hSaria opened this issue Dec 10, 2019 · 1 comment · Fixed by #3751
Closed
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@hSaria
Copy link
Contributor

hSaria commented Dec 10, 2019

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.8

When attempting to browse to the password-change page of a local user, an exception is thrown. Continuation on #3747.

Steps to Reproduce

  1. Create local user
  2. Login with user
  3. Navigate to /user/password/

Expected Behavior

Page loads and allows me to enter the details of the new password

Observed Behavior

Below exception is thrown

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.
@hSaria
Copy link
Contributor Author

hSaria commented Dec 10, 2019

This is a bug introduced in b1761f7#diff-73376e8b4737afa086136adcf5270ae6R99.

Just gotta replace in netbox/users/views.py

- if getattr(request.user, 'ldap_username'):
+ if getattr(request.user, 'ldap_username', None):

@jeremystretch jeremystretch added status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation type: bug A confirmed report of unexpected behavior in the application labels Dec 10, 2019
@jeremystretch jeremystretch added status: accepted This issue has been accepted for implementation and removed status: needs owner This issue is tentatively accepted pending a volunteer committed to its implementation labels Dec 11, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants