API: Minor fix for nil pointer when trying to log error during creating new dashboard via the API (#18003)

* Minor fix for nil pointer when trying to log error

* Do not return error if a dashboard is created

Only log the failures

* Do not return error if the folder is created

Only log the failures

(cherry picked from commit f2ad3242be)
This commit is contained in:
Sofia Papagiannaki
2019-07-26 15:56:18 +02:00
committed by Leonard Gram
parent 5de014a91d
commit 81f8158010
2 changed files with 1 additions and 3 deletions
-1
View File
@@ -64,7 +64,6 @@ func (hs *HTTPServer) CreateFolder(c *m.ReqContext, cmd m.CreateFolderCommand) R
if hs.Cfg.EditorsCanAdmin {
if err := dashboards.MakeUserAdmin(hs.Bus, c.OrgId, c.SignedInUser.UserId, cmd.Result.Id, true); err != nil {
hs.log.Error("Could not make user admin", "folder", cmd.Result.Title, "user", c.SignedInUser.UserId, "error", err)
return Error(500, "Failed to make user admin of folder", err)
}
}