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

Commit 624110b

Browse files
authored
fix(slack): skip after hours notification if no participant (#5419)
1 parent 96b0b87 commit 624110b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,6 +1109,13 @@ def handle_case_after_hours_message(
11091109
participant = participant_service.get_by_case_id_and_email(
11101110
db_session=db_session, case_id=context["subject"].id, email=user.email
11111111
)
1112+
# handle no participant found
1113+
if not participant:
1114+
log.warning(
1115+
f"Participant not found for {user.email} in case {case.id}. Skipping after hours notification."
1116+
)
1117+
return
1118+
11121119
# get their timezone from slack
11131120
owner_tz = (dispatch_slack_service.get_user_info_by_email(client, email=owner_email))["tz"]
11141121
message = f"Responses may be delayed. The current case priority is *{case.case_priority.name}* and your message was sent outside of the Assignee's working hours (Weekdays, 9am-5pm, {owner_tz} timezone)."

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -887,6 +887,9 @@ def handle_after_hours_message(
887887
)
888888
# handle no participant found
889889
if not participant:
890+
log.warning(
891+
f"Participant not found for {user.email} in incident {incident.id}. Skipping after hours notification."
892+
)
890893
return
891894

892895
# get their timezone from slack

0 commit comments

Comments
 (0)