Fix crash on no service accounts (#44389)

* Fix crash on no service accounts

* Fix tests

* Update org_users.go

* Update org_users.go

* linter, again

* Update build.go

* Update pkg/services/serviceaccounts/tests/common.go

* fix: big D

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
This commit is contained in:
Jeremy Price
2022-02-04 11:06:30 +00:00
committed by GitHub
co-authored by Eric Leijonmarck
parent 74ee5262e8
commit 525d9d97a8
5 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ func (api *ServiceAccountsAPI) ListTokens(ctx *models.ReqContext) response.Respo
}
func (api *ServiceAccountsAPI) ListServiceAccounts(ctx *models.ReqContext) response.Response {
serviceAccounts, err := api.store.ListServiceAccounts(ctx.Req.Context(), ctx.OrgId)
serviceAccounts, err := api.store.ListServiceAccounts(ctx.Req.Context(), ctx.OrgId, -1)
if err != nil {
return response.Error(http.StatusInternalServerError, "Failed to list service accounts", err)
}