From 8e50871d4354448bc4708476bf42dcf9ec19fc17 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Sat, 20 Jun 2026 02:48:08 +0530 Subject: [PATCH] refactor(routes): replace user variable with auth context in search space snapshot functions --- surfsense_backend/app/routes/new_chat_routes.py | 3 +-- surfsense_backend/app/routes/search_spaces_routes.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/surfsense_backend/app/routes/new_chat_routes.py b/surfsense_backend/app/routes/new_chat_routes.py index 4c8f0043c..c850c7eed 100644 --- a/surfsense_backend/app/routes/new_chat_routes.py +++ b/surfsense_backend/app/routes/new_chat_routes.py @@ -1228,7 +1228,6 @@ async def create_thread_snapshot( session: AsyncSession = Depends(get_async_session), auth: AuthContext = Depends(get_auth_context), ): - user = auth.user """ Create a public snapshot of the thread. @@ -1239,7 +1238,7 @@ async def create_thread_snapshot( return await create_snapshot( session=session, thread_id=thread_id, - user=user, + auth=auth, ) diff --git a/surfsense_backend/app/routes/search_spaces_routes.py b/surfsense_backend/app/routes/search_spaces_routes.py index 33ef188bc..e92f7dfc1 100644 --- a/surfsense_backend/app/routes/search_spaces_routes.py +++ b/surfsense_backend/app/routes/search_spaces_routes.py @@ -438,7 +438,6 @@ async def list_search_space_snapshots( session: AsyncSession = Depends(get_async_session), auth: AuthContext = Depends(get_auth_context), ): - user = auth.user """ List all public chat snapshots for a search space. @@ -450,6 +449,6 @@ async def list_search_space_snapshots( snapshots = await list_snapshots_for_search_space( session=session, search_space_id=search_space_id, - user=user, + auth=auth, ) return PublicChatSnapshotsBySpaceResponse(snapshots=snapshots)