mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): make sure saved alerts are valid
This commit is contained in:
@@ -65,7 +65,7 @@ func ParseAlertsFromDashboard(cmd *m.SaveDashboardCommand) []*m.AlertRule {
|
||||
alert.DatasourceId = query.Result.Id
|
||||
}
|
||||
|
||||
if alert.Query != "" {
|
||||
if alert.ValidToSave() {
|
||||
alerts = append(alerts, alert)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ func (arr *AlertRuleReader) Fetch() []*AlertRule {
|
||||
model.Description = ruleDef.Description
|
||||
model.Aggregator = ruleDef.Aggregator
|
||||
model.State = ruleDef.State
|
||||
model.QueryRange = ruleDef.QueryRange
|
||||
res[i] = model
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user