Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Commit 207f37e

Browse files
authored
fix(slack): using participant id for manual engagement (#5432)
1 parent cea0f45 commit 207f37e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/dispatch/plugins/dispatch_slack/case/interactive.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,17 +403,20 @@ def engage(
403403
ack()
404404

405405
if form_data.get(DefaultBlockIds.participant_select):
406-
user_email = client.users_info(user=form_data[DefaultBlockIds.participant_select]["value"])[
407-
"user"
408-
]["profile"]["email"]
406+
participant_id = form_data[DefaultBlockIds.participant_select]["value"]
407+
participant = participant_service.get(db_session=db_session, participant_id=participant_id)
408+
if participant:
409+
user_email = participant.individual.email
410+
else:
411+
log.error(f"Participant not found for id {participant_id} when trying to engage user")
412+
return
409413
else:
410-
# TODO: log error
411414
return
412415

413416
if form_data.get(DefaultBlockIds.description_input):
414417
engagement = form_data[DefaultBlockIds.description_input]
415418
else:
416-
# TODO log error
419+
log.warning("Engagement text not found")
417420
return
418421

419422
case = case_service.get(db_session=db_session, case_id=context["subject"].id)

0 commit comments

Comments
 (0)