provisioning: check provisiong before saveCmd

This commit is contained in:
bergquist 2018-04-10 09:35:54 +02:00
parent 7845eab502
commit 77e7887e5e

View File

@ -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,