From 018814022464559336ab2f8d34fd3191262fe956 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 19 Dec 2023 20:20:37 +0300 Subject: [PATCH] cached-request-10 --- resolvers/chats.py | 1 - services/auth.py | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/resolvers/chats.py b/resolvers/chats.py index 087d3a8..21122f0 100644 --- a/resolvers/chats.py +++ b/resolvers/chats.py @@ -4,7 +4,6 @@ import uuid from models.chat import Chat, ChatUpdate from services.auth import login_required -from services.core import get_all_authors from services.presence import notify_chat from services.rediscache import redis from services.schema import mutation diff --git a/services/auth.py b/services/auth.py index 5ab8189..513242c 100644 --- a/services/auth.py +++ b/services/auth.py @@ -2,7 +2,7 @@ from functools import wraps from aiohttp import ClientSession from starlette.exceptions import HTTPException -from services.core import get_author +from services.core import get_author_by_user from settings import AUTH_URL @@ -60,7 +60,7 @@ def login_required(f): user_id = await check_auth(req) if 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: context["author_id"] = author["id"] return await f(*args, **kwargs)