This commit is contained in:
parent
2d588c549e
commit
2380e88168
|
@ -60,13 +60,10 @@ def login_required(f):
|
||||||
user_id = await check_auth(req)
|
user_id = await check_auth(req)
|
||||||
if user_id:
|
if user_id:
|
||||||
context["user_id"] = user_id
|
context["user_id"] = user_id
|
||||||
if not cached_authors:
|
authors_by_user, authors_by_id = get_all_authors() if not cached_authors else cached_authors
|
||||||
get_all_authors()
|
author = authors_by_user.get(user_id)
|
||||||
if cached_authors:
|
if author and "id" in author:
|
||||||
authors_by_user, authors_by_id = cached_authors
|
context["author_id"] = author["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 await f(*args, **kwargs)
|
||||||
|
|
||||||
return decorated_function
|
return decorated_function
|
||||||
|
|
Loading…
Reference in New Issue
Block a user