From 5af2f82dbf939daed627501972a15a32c7bdef0f Mon Sep 17 00:00:00 2001 From: Will Sheldon <114631109+wssheldon@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:24:09 -0800 Subject: [PATCH] only show Correlation context element if there are entiites in message --- src/dispatch/plugins/dispatch_slack/case/messages.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/dispatch/plugins/dispatch_slack/case/messages.py b/src/dispatch/plugins/dispatch_slack/case/messages.py index a558798954fc..9d68bca7c00f 100644 --- a/src/dispatch/plugins/dispatch_slack/case/messages.py +++ b/src/dispatch/plugins/dispatch_slack/case/messages.py @@ -223,8 +223,10 @@ def create_signal_messages(case: Case, channel_id: str, db_session: Session) -> ) signal_metadata_blocks.append(Divider()) - signal_metadata_blocks.append( - Context(elements=["Correlation is based on two weeks of signal data."]), - ) + if instance.entities: + signal_metadata_blocks.append( + Context(elements=["Correlation is based on two weeks of signal data."]), + ) + messages.append(Message(blocks=signal_metadata_blocks[:50]).build()["blocks"]) return messages