Skip to content

Commit

Permalink
Only show variant in case notification if it is set (#3984)
Browse files Browse the repository at this point in the history
* Only show variant in case notification if it exists

* walrus operator

---------

Co-authored-by: David Whittaker <[email protected]>
  • Loading branch information
2 people authored and metroid-samus committed Nov 29, 2023
1 parent a186a92 commit 995bf8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dispatch/plugins/dispatch_slack/case/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def create_case_message(case: Case, channel_id: str) -> list[Block]:
]

if case.signal_instances:
fields.append(f"*Variant* \n {case.signal_instances[0].signal.variant}")
if variant := case.signal_instances[0].signal.variant:
fields.append(f"*Variant* \n {variant}")

blocks = [
Context(elements=[f"* {case.name} - Case Details*"]),
Expand Down

0 comments on commit 995bf8f

Please sign in to comment.