Skip to content

Commit

Permalink
don't update engagement message for failed response (#3527)
Browse files Browse the repository at this point in the history
* don't update engagement message for failed response

* Update src/dispatch/plugins/dispatch_slack/case/interactive.py
  • Loading branch information
wssheldon authored Jun 23, 2023
1 parent b67bc5e commit 6f1a864
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1556,21 +1556,23 @@ def _send_response(success: bool) -> None:
channel=case.conversation.channel_id,
thread_ts=case.conversation.thread_id,
)
blocks = create_signal_engagement_message(
case=case,
channel_id=case.conversation.channel_id,
engagement=engagement,
signal_instance=signal_instance,
user=user,
engagement_status=engagement_status,
)
client.chat_update(
blocks=blocks,
channel=case.conversation.channel_id,
ts=signal_instance.engagement_thread_ts,
)

if success:
# We only update engagment message (which removes Confirm/Deny button) for success
# this allows the user to retry the confirmation if the MFA check failed
blocks = create_signal_engagement_message(
case=case,
channel_id=case.conversation.channel_id,
engagement=engagement,
signal_instance=signal_instance,
user=user,
engagement_status=engagement_status,
)
client.chat_update(
blocks=blocks,
channel=case.conversation.channel_id,
ts=signal_instance.engagement_thread_ts,
)
_resolve_case(case)

def _resolve_case(case: Case) -> None:
Expand Down

0 comments on commit 6f1a864

Please sign in to comment.