Skip to content

Commit

Permalink
Renames parameter create_resources to create_all_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
mvilanova committed Oct 4, 2023
1 parent f3e2e23 commit ff551a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
17 changes: 7 additions & 10 deletions src/dispatch/case/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def case_new_create_flow(
conversation_target: str = None,
service_id: int = None,
db_session: Session,
create_resources: bool = True,
create_all_resources: bool = True,
):
"""Runs the case new creation flow."""
# we get the case
Expand All @@ -197,11 +197,8 @@ def case_new_create_flow(
individual_participants=individual_participants,
team_participants=team_participants,
conversation_target=conversation_target,
create_resources=create_resources,
create_all_resources=create_all_resources,
)
if not create_resources:
# we still want to update the ticket, but not twice if resources are created
ticket_flows.update_case_ticket(case=case, db_session=db_session)

if case.case_priority.page_assignee:
if not service_id:
Expand Down Expand Up @@ -613,15 +610,15 @@ def case_create_resources_flow(
individual_participants: List[str],
team_participants: List[str],
conversation_target: str = None,
create_resources: bool = True,
create_all_resources: bool = True,
) -> None:
"""Runs the case resource creation flow."""
case = get(db_session=db_session, case_id=case_id)

if case.assignee:
individual_participants.append((case.assignee.individual, None))

if create_resources:
if create_all_resources:
# we create the tactical group
direct_participant_emails = [i.email for i, _ in individual_participants]

Expand Down Expand Up @@ -664,9 +661,6 @@ def case_create_resources_flow(
document=case.case_document, project_id=case.project.id, db_session=db_session
)

# we update the ticket
ticket_flows.update_case_ticket(case=case, db_session=db_session)

try:
# we create the conversation and add participants to the thread
conversation_flows.create_case_conversation(case, conversation_target, db_session)
Expand Down Expand Up @@ -711,3 +705,6 @@ def case_create_resources_flow(
case_id=case.id,
)
log.exception(e)

# we update the ticket
ticket_flows.update_case_ticket(case=case, db_session=db_session)
2 changes: 1 addition & 1 deletion src/dispatch/signal/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def signal_instance_create_flow(
service_id=None,
conversation_target=conversation_target,
case_id=case.id,
create_resources=False,
create_all_resources=False,
)

if signal_instance.signal.engagements and entities:
Expand Down

0 comments on commit ff551a1

Please sign in to comment.