Skip to content

Commit

Permalink
Fixes issues with case messaging (#3060)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss authored Mar 6, 2023
1 parent c2315c3 commit 2b358b8
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/dispatch/plugins/dispatch_slack/case/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2b358b8

Please sign in to comment.