Skip to content

Commit 3d22e4b

Browse files
committed
default check SMTP
1 parent 7e83ea3 commit 3d22e4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/notifier/SMTPNotificationService.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ func (impl *SMTPNotificationServiceImpl) DeleteNotificationConfig(deleteReq *bea
175175
impl.logger.Errorw("found notifications using this config, cannot delete", "config", deleteReq)
176176
return fmt.Errorf(" Please delete all notifications using this config before deleting")
177177
}
178+
// check if default then dont delete
179+
if existingConfig.Default {
180+
return fmt.Errorf("default configuration cannot be deleted")
181+
}
178182
existingConfig.UpdatedOn = time.Now()
179183
existingConfig.UpdatedBy = userId
180184
//deleting smtp config

0 commit comments

Comments
 (0)