author-id-fix
All checks were successful
deploy / deploy (push) Successful in 1m6s

This commit is contained in:
Untone 2023-12-19 17:10:42 +03:00
parent e2bcffdc4c
commit d75f31072c
2 changed files with 2 additions and 6 deletions

View File

@ -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)

View File

@ -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)