feat(alerting): make sure saved alerts are valid

This commit is contained in:
bergquist
2016-06-09 10:27:23 +02:00
parent a1f97e0b77
commit 544073b7e1
3 changed files with 6 additions and 1 deletions

View File

@@ -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)
}
}

View File

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