diff --git a/src/dispatch/case/flows.py b/src/dispatch/case/flows.py index 0736474f4cfa..51dee63b5507 100644 --- a/src/dispatch/case/flows.py +++ b/src/dispatch/case/flows.py @@ -744,6 +744,15 @@ def common_escalate_flow( db_session.add(incident) db_session.commit() + # we run the incident create flow in a background task + incident = incident_flows.incident_create_flow( + incident_id=incident.id, + organization_slug=organization_slug, + db_session=db_session, + case_id=case.id, + ) + + # we link the case to the incident case.incidents.append(incident) db_session.add(case) db_session.commit() @@ -755,14 +764,6 @@ def common_escalate_flow( case_id=case.id, ) - # we run the incident create flow in a background task - incident = incident_flows.incident_create_flow( - incident_id=incident.id, - organization_slug=organization_slug, - db_session=db_session, - case_id=case.id, - ) - # we add the case participants to the incident for participant in case.participants: # check to see if already a participant in the incident diff --git a/src/dispatch/database/service.py b/src/dispatch/database/service.py index 39dd25144cd0..ba326ff4edea 100644 --- a/src/dispatch/database/service.py +++ b/src/dispatch/database/service.py @@ -536,7 +536,7 @@ def search_filter_sort_paginate( db_session, model, query_str: str = None, - filter_spec: str = None, + filter_spec: str | dict | None = None, page: int = 1, items_per_page: int = 5, sort_by: List[str] = None, @@ -558,7 +558,10 @@ def search_filter_sort_paginate( tag_all_filters = [] if filter_spec: - filter_spec = json.loads(filter_spec) + # some functions pass filter_spec as dictionary such as auth/views.py/get_users + # but most come from API as seraialized JSON + if isinstance(filter_spec, str): + filter_spec = json.loads(filter_spec) query = apply_filter_specific_joins(model_cls, filter_spec, query) # if the filter_spec has the TagAll filter, we need to split the query up # and intersect all of the results diff --git a/src/dispatch/signal/service.py b/src/dispatch/signal/service.py index 751201594093..eff71818ccef 100644 --- a/src/dispatch/signal/service.py +++ b/src/dispatch/signal/service.py @@ -536,14 +536,6 @@ def update(*, db_session: Session, signal: Signal, signal_in: SignalUpdate) -> S return signal -def delete(*, db_session: Session, signal_id: int): - """Deletes a signal definition.""" - signal = db_session.query(Signal).filter(Signal.id == signal_id).one() - db_session.delete(signal) - db_session.commit() - return signal_id - - def is_valid_uuid(val): try: uuid.UUID(str(val), version=4) diff --git a/src/dispatch/signal/views.py b/src/dispatch/signal/views.py index e8dab18aabe7..74202f39e4a8 100644 --- a/src/dispatch/signal/views.py +++ b/src/dispatch/signal/views.py @@ -36,7 +36,6 @@ create, create_signal_engagement, create_signal_filter, - delete, delete_signal_filter, get, get_by_primary_or_external_id, @@ -330,19 +329,3 @@ def update_signal( ) from None return signal - - -@router.delete( - "/{signal_id}", - response_model=None, - dependencies=[Depends(PermissionsDependency([SensitiveProjectActionPermission]))], -) -def delete_signal(db_session: DbSession, signal_id: Union[str, PrimaryKey]): - """Deletes a signal.""" - signal = get_by_primary_or_external_id(db_session=db_session, signal_id=signal_id) - if not signal: - raise HTTPException( - status_code=status.HTTP_404_NOT_FOUND, - detail=[{"msg": "A signal with this id does not exist."}], - ) - delete(db_session=db_session, signal_id=signal.id) diff --git a/src/dispatch/static/dispatch/src/incident/TimelineReportTab.vue b/src/dispatch/static/dispatch/src/incident/TimelineReportTab.vue index 0518f1480ef0..adae8685783a 100644 --- a/src/dispatch/static/dispatch/src/incident/TimelineReportTab.vue +++ b/src/dispatch/static/dispatch/src/incident/TimelineReportTab.vue @@ -27,9 +27,6 @@ Needs {{ event.details.needs }} -
- {{ event.source }} -
diff --git a/src/dispatch/static/dispatch/src/signal/DeleteDialog.vue b/src/dispatch/static/dispatch/src/signal/DeleteDialog.vue deleted file mode 100644 index 7036ee81151d..000000000000 --- a/src/dispatch/static/dispatch/src/signal/DeleteDialog.vue +++ /dev/null @@ -1,35 +0,0 @@ - - - diff --git a/src/dispatch/static/dispatch/src/signal/Table.vue b/src/dispatch/static/dispatch/src/signal/Table.vue index 7b7a5fb1116f..0a438ba65f49 100644 --- a/src/dispatch/static/dispatch/src/signal/Table.vue +++ b/src/dispatch/static/dispatch/src/signal/Table.vue @@ -1,7 +1,6 @@ @@ -104,12 +100,12 @@