Fix: Allow creating snapshot with no dashboard id (#58669)

This commit is contained in:
Gabriel MABILLE 2022-11-29 09:29:27 +01:00 committed by GitHub
parent 839465ae44
commit d279b6d7b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -130,11 +130,6 @@ func (hs *HTTPServer) CreateDashboardSnapshot(c *models.ReqContext) response.Res
metrics.MApiDashboardSnapshotExternal.Inc() metrics.MApiDashboardSnapshotExternal.Inc()
} else { } else {
if cmd.Dashboard.Get("id").MustInt64() == 0 {
c.JSON(http.StatusBadRequest, "Creating a local snapshot requires a dashboard")
return nil
}
if cmd.Key == "" { if cmd.Key == "" {
var err error var err error
cmd.Key, err = util.GetRandomString(32) cmd.Key, err = util.GetRandomString(32)