Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(case): log warning instead of throw exception #5604

Merged
merged 1 commit into from
Dec 11, 2024
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
6 changes: 3 additions & 3 deletions src/dispatch/case/messaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,9 @@ def send_case_welcome_participant_message(
"assignee_fullname": case.assignee.individual.name,
"assignee_team": case.assignee.team,
"assignee_weblink": case.assignee.individual.weblink,
"reporter_fullname": case.reporter.individual.name,
"reporter_team": case.reporter.team,
"reporter_weblink": case.reporter.individual.weblink,
"reporter_fullname": case.reporter.individual.name if case.reporter else None,
"reporter_team": case.reporter.team if case.reporter else None,
"reporter_weblink": case.reporter.individual.weblink if case.reporter else None,
"document_weblink": resolve_attr(case, "case_document.weblink"),
"storage_weblink": resolve_attr(case, "storage.weblink"),
"ticket_weblink": resolve_attr(case, "ticket.weblink"),
Expand Down
10 changes: 8 additions & 2 deletions src/dispatch/conversation/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,15 @@ def create_case_conversation(
# Do not overwrite a case conversation with one of the same type (thread, channel)
if case.conversation:
if case.has_channel:
raise RuntimeError("Case already has a dedicated channel conversation.")
log.warning(
f"Trying to create case conversation but case {case.id} already has a dedicated channel conversation."
)
return
if case.has_thread and not case.dedicated_channel:
raise RuntimeError("Case already has a thread conversation.")
log.warning(
"Trying to create case conversation but case {case.id} already has a thread conversation."
)
return

# This case is a thread version, we send a new messaged (threaded) to the conversation target
# for the configured case type
Expand Down
Loading