mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Await the calls to the db in the notion.py file
This commit is contained in:
@@ -45,7 +45,7 @@ async def notion_auth_callback(request: Request, background_tasks: BackgroundTas
|
|||||||
|
|
||||||
user: KhojUser = await aget_user_by_uuid(state)
|
user: KhojUser = await aget_user_by_uuid(state)
|
||||||
|
|
||||||
NotionConfig.objects.filter(user=user).adelete()
|
await NotionConfig.objects.filter(user=user).adelete()
|
||||||
|
|
||||||
if not user:
|
if not user:
|
||||||
raise Exception("User not found")
|
raise Exception("User not found")
|
||||||
@@ -72,9 +72,7 @@ async def notion_auth_callback(request: Request, background_tasks: BackgroundTas
|
|||||||
logger.info(f"Notion auth callback response: {final_response}")
|
logger.info(f"Notion auth callback response: {final_response}")
|
||||||
|
|
||||||
access_token = final_response.get("access_token")
|
access_token = final_response.get("access_token")
|
||||||
notion_config = NotionConfig.objects.acreate(token=access_token, user=user)
|
await NotionConfig.objects.acreate(token=access_token, user=user)
|
||||||
|
|
||||||
logger.info(f"Notion config created: {notion_config}")
|
|
||||||
|
|
||||||
owner = final_response.get("owner")
|
owner = final_response.get("owner")
|
||||||
workspace_id = final_response.get("workspace_id")
|
workspace_id = final_response.get("workspace_id")
|
||||||
|
|||||||
Reference in New Issue
Block a user