Skip to content

Commit

Permalink
Don't send update notifications on closed incidents. (#1846)
Browse files Browse the repository at this point in the history
Co-authored-by: Marc Vilanova <[email protected]>
  • Loading branch information
kevgliss and mvilanova authored Dec 1, 2021
1 parent f09c93a commit df04196
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/dispatch/incident/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,14 +311,20 @@ def send_incident_update_notifications(
if previous_incident.status != incident.status:
change = True
notification_template.append(INCIDENT_STATUS_CHANGE)
if previous_incident.incident_type.name != incident.incident_type.name:
notification_template.append(INCIDENT_TYPE_CHANGE)

if previous_incident.incident_type.name != incident.incident_type.name:
change = True
notification_template.append(INCIDENT_TYPE_CHANGE)

if previous_incident.incident_priority.name != incident.incident_priority.name:
change = True
notification_template.append(INCIDENT_PRIORITY_CHANGE)
if previous_incident.incident_priority.name != incident.incident_priority.name:
notification_template.append(INCIDENT_PRIORITY_CHANGE)
else:
if incident.status != IncidentStatus.closed:
if previous_incident.incident_type.name != incident.incident_type.name:
change = True
notification_template.append(INCIDENT_TYPE_CHANGE)

if previous_incident.incident_priority.name != incident.incident_priority.name:
change = True
notification_template.append(INCIDENT_PRIORITY_CHANGE)

if not change:
# we don't need to notify
Expand Down

0 comments on commit df04196

Please sign in to comment.