From c90e68d3ae0129d56fd99940fda258fa0e32bfc6 Mon Sep 17 00:00:00 2001 From: Untone Date: Tue, 19 Dec 2023 19:22:26 +0300 Subject: [PATCH] cached-request-5 --- services/auth.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/auth.py b/services/auth.py index c0e3222..d76d71e 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_all_authors +from services.core import get_all_authors, cached_authors 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 - authors_by_user, authors_by_id = get_all_authors() + authors_by_user, authors_by_id = cached_authors author = authors_by_user.get(user_id) if author and "id" in author: context["author_id"] = author["id"]