precache-fix
All checks were successful
deploy / deploy (push) Successful in 1m5s

This commit is contained in:
2023-12-19 18:13:37 +03:00
parent 531eb1f028
commit 95a237f349
8 changed files with 21 additions and 29 deletions

View File

@@ -2,6 +2,7 @@ from functools import wraps
from aiohttp import ClientSession
from starlette.exceptions import HTTPException
from services.core import authors_by_user
from settings import AUTH_URL
@@ -59,6 +60,9 @@ def login_required(f):
user_id = await check_auth(req)
if user_id:
context["user_id"] = user_id
author = authors_by_user.get(user_id)
if author and "id" in author:
context["author_id"] = author["id"]
return await f(*args, **kwargs)
return decorated_function