Skip to content

Commit 69300c6

Browse files
johannaenglandhmpf
authored andcommitted
Send notifications for events not covered by PMs
1 parent af5d491 commit 69300c6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

changelog.d/1588.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Filter out events covered by ongoing planned maintenance tasks from being sent

src/argus/incident/signals.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from argus.notificationprofile.media import send_notifications_to_users
55
from argus.notificationprofile.media import background_send_notification
66
from argus.notificationprofile.media import send_notification
7+
from argus.plannedmaintenance.utils import event_covered_by_planned_maintenance
78
from .models import (
89
Acknowledgement,
910
Event,
@@ -28,10 +29,14 @@ def delete_associated_user(sender, instance: SourceSystem, *args, **kwargs):
2829

2930

3031
def task_send_notification(sender, instance: Event, *args, **kwargs):
32+
if event_covered_by_planned_maintenance(event=instance):
33+
return
3134
send_notifications_to_users(instance)
3235

3336

3437
def task_background_send_notification(sender, instance: Event, *args, **kwargs):
38+
if event_covered_by_planned_maintenance(event=instance):
39+
return
3540
send_notifications_to_users(instance, send=background_send_notification)
3641

3742

0 commit comments

Comments
 (0)