Explorar o código

#3139: Add a message indicating why the user is redirected

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

+ 2 - 1
netbox/users/views.py

@@ -96,7 +96,8 @@ class ChangePasswordView(LoginRequiredMixin, View):
 
     def get(self, request):
         # LDAP users cannot change their password here
-        if getattr(request.user, 'ldap_username', None):
+        if getattr(request.user, 'ldap_username'):
+            messages.warning(request, "LDAP-authenticated user credentials cannot be changed within NetBox.")
             return redirect('user:profile')
 
         form = PasswordChangeForm(user=request.user)