This commit is contained in:
parent
2253bcf956
commit
0188140224
|
@ -4,7 +4,6 @@ import uuid
|
||||||
|
|
||||||
from models.chat import Chat, ChatUpdate
|
from models.chat import Chat, ChatUpdate
|
||||||
from services.auth import login_required
|
from services.auth import login_required
|
||||||
from services.core import get_all_authors
|
|
||||||
from services.presence import notify_chat
|
from services.presence import notify_chat
|
||||||
from services.rediscache import redis
|
from services.rediscache import redis
|
||||||
from services.schema import mutation
|
from services.schema import mutation
|
||||||
|
|
|
@ -2,7 +2,7 @@ from functools import wraps
|
||||||
from aiohttp import ClientSession
|
from aiohttp import ClientSession
|
||||||
from starlette.exceptions import HTTPException
|
from starlette.exceptions import HTTPException
|
||||||
|
|
||||||
from services.core import get_author
|
from services.core import get_author_by_user
|
||||||
from settings import AUTH_URL
|
from settings import AUTH_URL
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ def login_required(f):
|
||||||
user_id = await check_auth(req)
|
user_id = await check_auth(req)
|
||||||
if user_id:
|
if user_id:
|
||||||
context["user_id"] = user_id
|
context["user_id"] = user_id
|
||||||
author = get_author(user_id)
|
author = get_author_by_user(user_id)
|
||||||
if author and "id" in author:
|
if author and "id" in author:
|
||||||
context["author_id"] = author["id"]
|
context["author_id"] = author["id"]
|
||||||
return await f(*args, **kwargs)
|
return await f(*args, **kwargs)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user