API: Do not validate/save legacy alerts when saving a dashboard if legacy alerting is disabled (#51883)
* API: Do not validate/save legacy alerts if legacy alerting is disabled Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
This commit is contained in:
co-authored by
Ida Furjesova
parent
c4c7908f51
commit
b3992df988
@@ -1445,6 +1445,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