-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Import the standard response notifications (#66)
- Loading branch information
Tom Withers
authored
Dec 18, 2020
1 parent
7f3c222
commit 00a4d1c
Showing
1 changed file
with
11 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,20 @@ | ||
from response.core.models import Incident | ||
from response.slack.models import CommsChannel | ||
from response.slack.decorators import recurring_notification, single_notification | ||
|
||
from response.slack import incident_notifications | ||
|
||
@single_notification() | ||
def incident_response_process(incident: Incident): | ||
comms_channel = CommsChannel.objects.get(incident=incident) | ||
comms_channel.post_in_channel("📗 You can find our Incident Response process here https://ministryofjustice.github.io/opg-technical-guidance/incidents/incident-response-process/#incident-response-process") | ||
try: | ||
comms_channel = CommsChannel.objects.get(incident=incident) | ||
comms_channel.post_in_channel("📗 You can find our Incident Response process here https://ministryofjustice.github.io/opg-technical-guidance/incidents/incident-response-process/#incident-response-process") | ||
except CommsChannel.DoesNotExist: | ||
pass | ||
|
||
@recurring_notification(interval_mins=30, max_notifications=10) | ||
def take_a_break(incident: Incident): | ||
comms_channel = CommsChannel.objects.get(incident=incident) | ||
comms_channel.post_in_channel("👋 30 minutes have elapsed. Think about taking a few minutes away from the screen.") | ||
try: | ||
comms_channel = CommsChannel.objects.get(incident=incident) | ||
comms_channel.post_in_channel("👋 30 minutes have elapsed. Think about taking a few minutes away from the screen.") | ||
except CommsChannel.DoesNotExist: | ||
pass |