From 97a3fc51cf533b4bf7dd976d20686d5028dc0f7c Mon Sep 17 00:00:00 2001 From: Jason Schroth Date: Tue, 31 Oct 2023 15:00:54 -0700 Subject: [PATCH 1/2] handle possible null actions interactive.py It is possible that there are tasks, but there is no previous actions value so actions is None. This addresses that issue by setting actions to an empty string if it is None. --- src/dispatch/plugins/dispatch_slack/incident/interactive.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dispatch/plugins/dispatch_slack/incident/interactive.py b/src/dispatch/plugins/dispatch_slack/incident/interactive.py index 509bd083eb3a..3ce493a7b8a9 100644 --- a/src/dispatch/plugins/dispatch_slack/incident/interactive.py +++ b/src/dispatch/plugins/dispatch_slack/incident/interactive.py @@ -1531,6 +1531,7 @@ def handle_report_tactical_command( incident = incident_service.get(db_session=db_session, incident_id=context["subject"].id) if incident.tasks: + actions = "" if actions == None else actions actions += "\n\nOutstanding Incident Tasks:\n".join( [ "-" + task.description From 200587adf502e6c1ea09079017e8f46d308ce55c Mon Sep 17 00:00:00 2001 From: Jason Schroth Date: Tue, 31 Oct 2023 15:09:23 -0700 Subject: [PATCH 2/2] fix lint had lint error for "is none" --- src/dispatch/plugins/dispatch_slack/incident/interactive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dispatch/plugins/dispatch_slack/incident/interactive.py b/src/dispatch/plugins/dispatch_slack/incident/interactive.py index 3ce493a7b8a9..27250703b5f2 100644 --- a/src/dispatch/plugins/dispatch_slack/incident/interactive.py +++ b/src/dispatch/plugins/dispatch_slack/incident/interactive.py @@ -1531,7 +1531,7 @@ def handle_report_tactical_command( incident = incident_service.get(db_session=db_session, incident_id=context["subject"].id) if incident.tasks: - actions = "" if actions == None else actions + actions = "" if actions is None else actions actions += "\n\nOutstanding Incident Tasks:\n".join( [ "-" + task.description