From 7fe84925014404742bcc3c4e6ac67c9f3daddf07 Mon Sep 17 00:00:00 2001 From: Marc Vilanova Date: Wed, 13 Nov 2024 15:14:56 -0800 Subject: [PATCH] Removes delete endpoint and related service function --- src/dispatch/signal/service.py | 8 -------- src/dispatch/signal/views.py | 17 ----------------- 2 files changed, 25 deletions(-) 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)