author-getting-fix
All checks were successful
deploy / deploy (push) Successful in 1m4s

This commit is contained in:
2023-12-19 17:24:52 +03:00
parent d75f31072c
commit 8c1f52f99b
5 changed files with 67 additions and 55 deletions

View File

@@ -2,9 +2,6 @@ from functools import wraps
from aiohttp import ClientSession
from starlette.exceptions import HTTPException
from models.member import ChatMember
from services.core import authors_by_user
from settings import AUTH_URL
@@ -63,9 +60,6 @@ def login_required(f):
user_id = await check_auth(req)
if user_id:
context["user_id"] = user_id
author: ChatMember | None = authors_by_user.get(user_id)
if author:
context["author_id"] = author["id"]
return await f(*args, **kwargs)
return decorated_function