diff --git a/pkg/services/dashboards/dashboard_service.go b/pkg/services/dashboards/dashboard_service.go index 7c51c412d39..0f17270419f 100644 --- a/pkg/services/dashboards/dashboard_service.go +++ b/pkg/services/dashboards/dashboard_service.go @@ -93,6 +93,11 @@ func (dr *dashboardServiceImpl) buildSaveDashboardCommand(dto *SaveDashboardDTO, } } + err := dr.validateDashboardIsNotProvisioned(dash.Id) + if err != nil { + return nil, err + } + validateBeforeSaveCmd := models.ValidateDashboardBeforeSaveCommand{ OrgId: dto.OrgId, Dashboard: dash, @@ -111,11 +116,6 @@ func (dr *dashboardServiceImpl) buildSaveDashboardCommand(dto *SaveDashboardDTO, return nil, models.ErrDashboardUpdateAccessDenied } - err := dr.validateDashboardIsNotProvisioned(dash.Id) - if err != nil { - return nil, err - } - cmd := &models.SaveDashboardCommand{ Dashboard: dash.Data, Message: dto.Message,