This commit is contained in:
parent
53545605d0
commit
d5d5a69ab4
|
@ -80,10 +80,12 @@ async def get_cached_author_by_user_id(user_id: str, get_with_stat) -> dict:
|
||||||
author_dict = None
|
author_dict = None
|
||||||
if not author_str:
|
if not author_str:
|
||||||
author_query = select(Author).filter(Author.user == user_id)
|
author_query = select(Author).filter(Author.user == user_id)
|
||||||
[author_with_stat] = get_with_stat(author_query)
|
result = get_with_stat(author_query)
|
||||||
if author_with_stat:
|
if result:
|
||||||
await cache_author(author_with_stat.dict())
|
[author_with_stat] = result
|
||||||
author_dict = author_with_stat.dict()
|
if author_with_stat:
|
||||||
|
await cache_author(author_with_stat.dict())
|
||||||
|
author_dict = author_with_stat.dict()
|
||||||
else:
|
else:
|
||||||
author_dict = json.loads(author_str)
|
author_dict = json.loads(author_str)
|
||||||
return author_dict
|
return author_dict
|
||||||
|
|
Loading…
Reference in New Issue
Block a user