aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/netbox/files/patch-netbox_users_views.py
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/netbox/files/patch-netbox_users_views.py')
-rw-r--r--net-mgmt/netbox/files/patch-netbox_users_views.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/net-mgmt/netbox/files/patch-netbox_users_views.py b/net-mgmt/netbox/files/patch-netbox_users_views.py
new file mode 100644
index 000000000000..77685215ebb7
--- /dev/null
+++ b/net-mgmt/netbox/files/patch-netbox_users_views.py
@@ -0,0 +1,16 @@
+Fix exception on password change page for local users
+
+Obtained from:
+https://github.com/netbox-community/netbox/commit/3b03d68ac70be1b5b9912d0a4d2a5fecd25cede4
+
+--- netbox/users/views.py.orig 2019-12-10 15:47:48 UTC
++++ netbox/users/views.py
+@@ -96,7 +96,7 @@ class ChangePasswordView(LoginRequiredMixin, View):
+
+ def get(self, request):
+ # LDAP users cannot change their password here
+- if getattr(request.user, 'ldap_username'):
++ if getattr(request.user, 'ldap_username', None):
+ messages.warning(request, "LDAP-authenticated user credentials cannot be changed within NetBox.")
+ return redirect('user:profile')
+