update retrieve channel logic
This commit is contained in:
parent
24072cd0a1
commit
a44f93a14c
|
@ -77,7 +77,7 @@ func RetrieveChannel(ch *alerting.Channel) (*alerting.Channel, error) {
|
||||||
return nil, fmt.Errorf("empty channel")
|
return nil, fmt.Errorf("empty channel")
|
||||||
}
|
}
|
||||||
enabled := ch.Enabled
|
enabled := ch.Enabled
|
||||||
if ch.ID != "" {
|
if ch.ID != "" && ((ch.Email == nil && ch.Type == alerting.ChannelEmail) || (ch.Webhook == nil && ch.Type == alerting.ChannelWebhook)) {
|
||||||
_, err := orm.Get(ch)
|
_, err := orm.Get(ch)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue