[v9.2.x] Fix: Allow creating snapshot with no dashboard id (#59465)

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

(cherry picked from commit d279b6d7b0)

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-11-29 10:09:08 +01:00
committed by GitHub
co-authored by Gabriel MABILLE
parent 6b4394d8e6
commit ac9819bfa5
-5
View File
@@ -130,11 +130,6 @@ func (hs *HTTPServer) CreateDashboardSnapshot(c *models.ReqContext) response.Res
metrics.MApiDashboardSnapshotExternal.Inc()
} else {
if cmd.Dashboard.Get("id").MustInt64() == 0 {
c.JSON(http.StatusBadRequest, "Creating a local snapshot requires a dashboard")
return nil
}
if cmd.Key == "" {
var err error
cmd.Key, err = util.GetRandomString(32)