瀏覽代碼

Fixes 3749 attribute error

hSaria 6 年之前
父節點
當前提交
3b76e0203a
共有 1 個文件被更改,包括 1 次插入1 次删除
  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')