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

This commit is contained in:
2023-12-19 19:30:51 +03:00
parent 2658cd323b
commit 2d588c549e
4 changed files with 12 additions and 11 deletions

View File

@@ -62,10 +62,11 @@ def login_required(f):
context["user_id"] = user_id
if not cached_authors:
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"]
if cached_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"]
return await f(*args, **kwargs)
return decorated_function