Skip to content

Commit

Permalink
Import the standard response notifications (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Withers authored Dec 18, 2020
1 parent 7f3c222 commit 00a4d1c
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions opgincidentresponse/actions/incident_notifications.py
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

0 comments on commit 00a4d1c

Please sign in to comment.