Skip to content

Commit

Permalink
Do not add the incident's tactical email as a member of the case stor…
Browse files Browse the repository at this point in the history
…age if it doesn't exist (#3705)
  • Loading branch information
mvilanova authored Aug 18, 2023
1 parent f016764 commit 44ce509
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/dispatch/case/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
from dispatch.incident.models import IncidentCreate
from dispatch.individual.models import IndividualContactRead
from dispatch.models import OrganizationSlug, PrimaryKey
from dispatch.participant import service as participant_service
from dispatch.participant import flows as participant_flows
from dispatch.participant_role import flows as role_flow
from dispatch.participant import service as participant_service
from dispatch.participant.models import ParticipantUpdate
from dispatch.participant_role import flows as role_flow
from dispatch.participant_role.models import ParticipantRoleType
from dispatch.plugin import service as plugin_service
from dispatch.storage import flows as storage_flows
Expand Down Expand Up @@ -593,22 +593,23 @@ def case_to_incident_escalate_flow(
case_id=case.id,
)

# we add the incident's tactical group to the case's storage folder
# to allow incident participants to access the case's artifacts in the folder
storage_members = [incident.tactical_group.email]
storage_flows.update_storage(
subject=case,
storage_action=StorageAction.add_members,
storage_members=storage_members,
db_session=db_session,
)
if case.storage:
# we add the incident's tactical group to the case's storage folder
# to allow incident participants to access the case's artifacts in the folder
storage_members = [incident.tactical_group.email]
storage_flows.update_storage(
subject=case,
storage_action=StorageAction.add_members,
storage_members=storage_members,
db_session=db_session,
)

event_service.log_case_event(
db_session=db_session,
source="Dispatch Core App",
description=f"The members of the incident's tactical group {incident.tactical_group.email} have been given permission to access the case's storage folder",
case_id=case.id,
)
event_service.log_case_event(
db_session=db_session,
source="Dispatch Core App",
description=f"The members of the incident's tactical group {incident.tactical_group.email} have been given permission to access the case's storage folder",
case_id=case.id,
)


@background_task
Expand Down

0 comments on commit 44ce509

Please sign in to comment.