Skip to content

Commit de73629

Browse files
authored
Only reactivate incident when status goes from closed to active (#765)
* Only reactivate incident when status goes from closed to active * Let's send the reminder also when we go from stable to active
1 parent 84c67a6 commit de73629

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/dispatch/incident/flows.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,9 @@ def status_flow_dispatcher(
916916
"""Runs the correct flows depending on the incident's current and previous status."""
917917
# we have a currently active incident
918918
if current_status == IncidentStatus.active:
919-
# re-activate incident
920-
incident_active_status_flow(incident=incident, db_session=db_session)
919+
if previous_status == IncidentStatus.closed:
920+
# re-activate incident
921+
incident_active_status_flow(incident=incident, db_session=db_session)
921922
send_incident_report_reminder(incident, ReportTypes.tactical_report, db_session)
922923

923924
# we currently have a stable incident
@@ -934,7 +935,6 @@ def status_flow_dispatcher(
934935
if previous_status == IncidentStatus.active:
935936
incident_stable_status_flow(incident=incident, db_session=db_session)
936937
incident_closed_status_flow(incident=incident, db_session=db_session)
937-
938938
elif previous_status == IncidentStatus.stable:
939939
incident_closed_status_flow(incident=incident, db_session=db_session)
940940

0 commit comments

Comments
 (0)