Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/dispatch/plugins/dispatch_slack/case/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,13 @@ def handle_case_after_hours_message(
participant = participant_service.get_by_case_id_and_email(
db_session=db_session, case_id=context["subject"].id, email=user.email
)
# handle no participant found
if not participant:
log.warning(
f"Participant not found for {user.email} in case {case.id}. Skipping after hours notification."
)
return

# get their timezone from slack
owner_tz = (dispatch_slack_service.get_user_info_by_email(client, email=owner_email))["tz"]
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)."
Expand Down
3 changes: 3 additions & 0 deletions src/dispatch/plugins/dispatch_slack/incident/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,9 @@ def handle_after_hours_message(
)
# handle no participant found
if not participant:
log.warning(
f"Participant not found for {user.email} in incident {incident.id}. Skipping after hours notification."
)
return

# get their timezone from slack
Expand Down
Loading