Skip to content

Commit

Permalink
be sure to add to incident before sending ephemeral message (#5553)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitdog47 authored Dec 4, 2024
1 parent b477750 commit ecbc7d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/dispatch/task/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def create(*, db_session, task_in: TaskCreate) -> Task:
db_session=db_session, incident_id=incident.id, email=i.individual.email
)

assignee = incident_flows.incident_add_or_reactivate_participant_flow(
db_session=db_session,
incident_id=incident.id,
user_email=i.individual.email,
)

if not participant or not participant.active_roles:
# send emphemeral message to user about why they are being added to the incident
send_task_add_ephemeral_message(
Expand All @@ -88,12 +94,6 @@ def create(*, db_session, task_in: TaskCreate) -> Task:
task=task_in,
)

assignee = incident_flows.incident_add_or_reactivate_participant_flow(
db_session=db_session,
incident_id=incident.id,
user_email=i.individual.email,
)

# due to the freeform nature of task assignment, we can sometimes pick up other emails
# e.g. a google group that we cannot resolve to an individual assignee
if assignee:
Expand Down

0 comments on commit ecbc7d1

Please sign in to comment.