cached-request
All checks were successful
deploy / deploy (push) Successful in 1m3s

This commit is contained in:
2023-12-19 18:58:26 +03:00
parent b141c26e80
commit 6c7f269206
6 changed files with 40 additions and 32 deletions

View File

@@ -2,7 +2,7 @@ from functools import wraps
from aiohttp import ClientSession
from starlette.exceptions import HTTPException
from services.core import authors_by_user
from services.core import get_all_authors
from settings import AUTH_URL
@@ -60,6 +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()
author = authors_by_user.get(user_id)
if author and "id" in author:
context["author_id"] = author["id"]