API: Do not validate/save legacy alerts when saving a dashboard if legacy alerting is disabled (#51883) (#52137)
* API: Do not validate/save legacy alerts if legacy alerting is disabled
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
(cherry picked from commit b3992df988)
Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
This commit is contained in:
co-authored by
Sofia Papagiannaki
parent
7d8fbb83f4
commit
f3f66f6325
@@ -1436,6 +1436,12 @@ func readAlertingSettings(iniFile *ini.File) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsLegacyAlertingEnabled returns whether the legacy alerting is enabled or not.
|
||||
// It's safe to be used only after readAlertingSettings() and ReadUnifiedAlertingSettings() are executed.
|
||||
func IsLegacyAlertingEnabled() bool {
|
||||
return AlertingEnabled != nil && *AlertingEnabled
|
||||
}
|
||||
|
||||
func readSnapshotsSettings(cfg *Cfg, iniFile *ini.File) error {
|
||||
snapshots := iniFile.Section("snapshots")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user