Browse Source

Ignore not chosen recipients for system notification types

pull/12229/head
ViacheslavKlimov 2 years ago
parent
commit
9cbe2ca4d5
  1. 2
      application/src/main/java/org/thingsboard/server/service/notification/DefaultNotificationCenter.java

2
application/src/main/java/org/thingsboard/server/service/notification/DefaultNotificationCenter.java

@ -149,7 +149,7 @@ public class DefaultNotificationCenter extends AbstractSubscriptionService imple
return; // if originated by rule - just ignore delivery method
}
}
if (ruleId == null) {
if (ruleId == null && !notificationTemplate.getNotificationType().isSystem()) {
if (targets.stream().noneMatch(target -> target.getConfiguration().getType().getSupportedDeliveryMethods().contains(deliveryMethod))) {
throw new IllegalArgumentException("Recipients for " + deliveryMethod.getName() + " delivery method not chosen");
}

Loading…
Cancel
Save