2
0
Эх сурвалжийг харах

Fixes 3749 attribute error

hSaria 6 жил өмнө
parent
commit
3b76e0203a

+ 1 - 1
netbox/users/views.py

@@ -96,7 +96,7 @@ class ChangePasswordView(LoginRequiredMixin, View):
 
 
     def get(self, request):
     def get(self, request):
         # LDAP users cannot change their password here
         # 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.")
             messages.warning(request, "LDAP-authenticated user credentials cannot be changed within NetBox.")
             return redirect('user:profile')
             return redirect('user:profile')