s/aget_all_filenames_by_source/get_all_filenames_by_source as sync func

This commit is contained in:
Debanjum Singh Solanky
2024-04-07 16:33:22 +05:30
parent e45edbb992
commit 3b630841bd
3 changed files with 3 additions and 3 deletions

View File

@@ -796,7 +796,7 @@ class EntryAdapters:
return await Entry.objects.filter(user=user, file_path=file_path).adelete() return await Entry.objects.filter(user=user, file_path=file_path).adelete()
@staticmethod @staticmethod
def aget_all_filenames_by_source(user: KhojUser, file_source: str): def get_all_filenames_by_source(user: KhojUser, file_source: str):
return ( return (
Entry.objects.filter(user=user, file_source=file_source) Entry.objects.filter(user=user, file_source=file_source)
.distinct("file_path") .distinct("file_path")

View File

@@ -225,7 +225,7 @@ async def get_all_filenames(
client=client, client=client,
) )
return await sync_to_async(list)(EntryAdapters.aget_all_filenames_by_source(user, content_source)) # type: ignore[call-arg] return await sync_to_async(list)(EntryAdapters.get_all_filenames_by_source(user, content_source)) # type: ignore[call-arg]
@api_config.post("/data/conversation/model", status_code=200) @api_config.post("/data/conversation/model", status_code=200)

View File

@@ -120,7 +120,7 @@ async def auth(request: Request):
api="create_user", api="create_user",
metadata={"user_id": str(khoj_user.uuid)}, metadata={"user_id": str(khoj_user.uuid)},
) )
logger.log(logging.INFO, f"New User Created: {khoj_user.uuid}") logger.log(logging.INFO, f"🥳 New User Created: {khoj_user.uuid}")
return RedirectResponse(url=f"{next_url}", status_code=HTTP_302_FOUND) return RedirectResponse(url=f"{next_url}", status_code=HTTP_302_FOUND)
return RedirectResponse(url=f"{next_url}") return RedirectResponse(url=f"{next_url}")