mirror of https://github.com/portainer/portainer
fix(api): fix an issue when removing non local administrators
parent
49516e2c3f
commit
130baddea0
|
@ -41,6 +41,10 @@ func (handler *Handler) userDelete(w http.ResponseWriter, r *http.Request) *http
|
|||
}
|
||||
|
||||
func (handler *Handler) deleteAdminUser(w http.ResponseWriter, user *portainer.User) *httperror.HandlerError {
|
||||
if user.Password == "" {
|
||||
return handler.deleteUser(w, user)
|
||||
}
|
||||
|
||||
users, err := handler.UserService.Users()
|
||||
if err != nil {
|
||||
return &httperror.HandlerError{http.StatusInternalServerError, "Unable to retrieve users from the database", err}
|
||||
|
|
Loading…
Reference in New Issue