mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
The problem here is that without the orgID we ignore the lookup of the existing notification channel just before updating and end up failing the update because there is no channel available.
(cherry picked from commit 8bf2e642aa
)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
parent
5b73b4e070
commit
3179d548bb
@ -2,6 +2,7 @@ package alerting
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/grafana/grafana/pkg/bus"
|
"github.com/grafana/grafana/pkg/bus"
|
||||||
"github.com/grafana/grafana/pkg/models"
|
"github.com/grafana/grafana/pkg/models"
|
||||||
@ -74,6 +75,7 @@ func (s *AlertNotificationService) UpdateAlertNotification(ctx context.Context,
|
|||||||
|
|
||||||
model := models.AlertNotification{
|
model := models.AlertNotification{
|
||||||
Id: cmd.Id,
|
Id: cmd.Id,
|
||||||
|
OrgId: cmd.OrgId,
|
||||||
Name: cmd.Name,
|
Name: cmd.Name,
|
||||||
Type: cmd.Type,
|
Type: cmd.Type,
|
||||||
Settings: cmd.Settings,
|
Settings: cmd.Settings,
|
||||||
@ -134,7 +136,11 @@ func (s *AlertNotificationService) createNotifier(ctx context.Context, model *mo
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if query.Result != nil && query.Result.SecureSettings != nil {
|
if query.Result == nil {
|
||||||
|
return nil, fmt.Errorf("unable to find the alert notification")
|
||||||
|
}
|
||||||
|
|
||||||
|
if query.Result.SecureSettings != nil {
|
||||||
var err error
|
var err error
|
||||||
secureSettingsMap, err = s.EncryptionService.DecryptJsonData(ctx, query.Result.SecureSettings, setting.SecretKey)
|
secureSettingsMap, err = s.EncryptionService.DecryptJsonData(ctx, query.Result.SecureSettings, setting.SecretKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user