Explorar o código

Fixes 3749 attribute error

hSaria %!s(int64=6) %!d(string=hai) anos
pai
achega
3b76e0203a
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      netbox/users/views.py

+ 1 - 1
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')