This commit is contained in:
parent
f15f14ecd9
commit
b1b7bf4dc2
|
@ -3,6 +3,7 @@ from functools import wraps
|
|||
import aiohttp
|
||||
from aiohttp.web import HTTPUnauthorized
|
||||
|
||||
from models.member import ChatMember
|
||||
from services.core import get_author
|
||||
from settings import AUTH_URL
|
||||
|
||||
|
@ -65,7 +66,9 @@ def login_required(f):
|
|||
raise HTTPUnauthorized(text="Please, login first")
|
||||
else:
|
||||
# Добавляем author_id и user_id в контекст
|
||||
context["author_id"] = await get_author(user_id)
|
||||
author: ChatMember | None = await get_author(user_id)
|
||||
if author:
|
||||
context["author_id"] = author["id"]
|
||||
context["user_id"] = user_id
|
||||
|
||||
# Если пользователь аутентифицирован, выполняем резолвер
|
||||
|
|
Loading…
Reference in New Issue
Block a user