diff --git a/surfsense_backend/alembic/versions/87_add_document_connector_id.py b/surfsense_backend/alembic/versions/87_add_document_connector_id.py index b075014ae..75abe8ab9 100644 --- a/surfsense_backend/alembic/versions/87_add_document_connector_id.py +++ b/surfsense_backend/alembic/versions/87_add_document_connector_id.py @@ -72,7 +72,7 @@ def upgrade() -> None: # 4. Backfill existing documents with connector_id based on document_type matching # This maps document types to their corresponding connector types # Only backfills for documents in search spaces that have exactly one connector of that type - + # Map of document_type -> connector_type for backfilling document_connector_mappings = [ ("NOTION_CONNECTOR", "NOTION_CONNECTOR"), @@ -168,4 +168,3 @@ def downgrade() -> None: END$$; """ ) - diff --git a/surfsense_backend/app/routes/composio_routes.py b/surfsense_backend/app/routes/composio_routes.py index c0a23a665..602aa876c 100644 --- a/surfsense_backend/app/routes/composio_routes.py +++ b/surfsense_backend/app/routes/composio_routes.py @@ -337,7 +337,9 @@ async def composio_callback( logger.info( f"Updating existing Composio connector {existing_connector.id} with new connected_account_id {final_connected_account_id}" ) - existing_config = existing_connector.config.copy() if existing_connector.config else {} + existing_config = ( + existing_connector.config.copy() if existing_connector.config else {} + ) existing_config.update(connector_config) existing_connector.config = existing_config diff --git a/surfsense_backend/app/tasks/celery_tasks/connector_deletion_task.py b/surfsense_backend/app/tasks/celery_tasks/connector_deletion_task.py index b794c58d0..0fd68637c 100644 --- a/surfsense_backend/app/tasks/celery_tasks/connector_deletion_task.py +++ b/surfsense_backend/app/tasks/celery_tasks/connector_deletion_task.py @@ -135,9 +135,7 @@ async def _delete_connector_async( break # Delete this batch (chunks are deleted via CASCADE) - await session.execute( - delete(Document).where(Document.id.in_(doc_ids)) - ) + await session.execute(delete(Document).where(Document.id.in_(doc_ids))) await session.commit() total_deleted += len(doc_ids) @@ -269,4 +267,3 @@ async def delete_documents_by_connector_id( total_deleted += len(doc_ids) return total_deleted -