From d75f31072c6b55a9f4b19617e9a17c5b9bcc6622 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 19 Dec 2023 17:10:42 +0300 Subject: [PATCH] author-id-fix --- services/auth.py | 4 ++-- services/core.py | 4 ---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/services/auth.py b/services/auth.py index 152f1f5..fd547f7 100644 --- a/services/auth.py +++ b/services/auth.py @@ -3,7 +3,7 @@ from aiohttp import ClientSession from starlette.exceptions import HTTPException from models.member import ChatMember -from services.core import get_author +from services.core import authors_by_user from settings import AUTH_URL @@ -63,7 +63,7 @@ def login_required(f): user_id = await check_auth(req) if user_id: context["user_id"] = user_id - author: ChatMember | None = await get_author(user_id) + author: ChatMember | None = authors_by_user.get(user_id) if author: context["author_id"] = author["id"] return await f(*args, **kwargs) diff --git a/services/core.py b/services/core.py index 9a80d7c..2379e05 100644 --- a/services/core.py +++ b/services/core.py @@ -52,7 +52,3 @@ async def get_my_followed() -> List[ChatMember]: } return await _request_endpoint(query_name, gql) or [] - - -async def get_author(user: str = ""): - return authors_by_user.get(user)