mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
dashboards: reject updates of provisioned dashboards
This commit is contained in:
@@ -21,12 +21,17 @@ type DashboardExtras struct {
|
||||
func GetProvisionedDataByDashboardId(cmd *models.GetProvisionedDashboardByDashboardId) error {
|
||||
result := &models.DashboardProvisioning{}
|
||||
|
||||
_, err := x.Where("dashboard_id = ?", cmd.DashboardId).Get(result)
|
||||
exist, err := x.Where("dashboard_id = ?", cmd.DashboardId).Get(result)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if !exist {
|
||||
return models.ErrDashboardProvisioningDoesNotExist
|
||||
}
|
||||
|
||||
cmd.Result = result
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user