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

Only run member join or remove for incident channels #4457

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions src/dispatch/plugins/dispatch_slack/incident/interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,10 @@ def handle_member_joined_channel(
"Unable to handle member_joined_channel Slack event. Dispatch user unknown."
)

if context["subject"].type != "incident":
whitdog47 marked this conversation as resolved.
Show resolved Hide resolved
# only run this workflow for incidents
return

participant = incident_flows.incident_add_or_reactivate_participant_flow(
user_email=user.email, incident_id=context["subject"].id, db_session=db_session
)
Expand Down Expand Up @@ -1001,6 +1005,10 @@ def handle_member_left_channel(
) -> None:
ack()

if context["subject"].type != "incident":
# only run this workflow for incidents
return

incident_flows.incident_remove_participant_flow(
user.email, context["subject"].id, db_session=db_session
)
Expand Down
Loading