From 120a5b1161140368976e6d2dd6ff3c663597a9d3 Mon Sep 17 00:00:00 2001 From: Kevin Glisson Date: Mon, 6 Mar 2023 13:16:25 -0800 Subject: [PATCH] Fixes issues with case messaging --- src/dispatch/plugins/dispatch_slack/case/messages.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/dispatch/plugins/dispatch_slack/case/messages.py b/src/dispatch/plugins/dispatch_slack/case/messages.py index 66db3476d8b2..49807e7222eb 100644 --- a/src/dispatch/plugins/dispatch_slack/case/messages.py +++ b/src/dispatch/plugins/dispatch_slack/case/messages.py @@ -182,9 +182,12 @@ def create_signal_messages(case: Case) -> List[Message]: Section(fields=[f"*{k.strip()}* \n {v.strip()}" for k, v in chunk]), ) else: - signal_metadata_blocks.append( - Section(text=item["value"]), - ) - messages.append(Message(blocks=signal_metadata_blocks).build()["blocks"]) + # remove empty strings + if item["value"]: + signal_metadata_blocks.append( + Section(text=str(item["value"]).strip()), + ) + # limit the number of total messages + messages.append(Message(blocks=signal_metadata_blocks[:50]).build()["blocks"]) return messages