This commit is contained in:
parent
13e2a4b7ba
commit
13bff800f0
|
@ -44,12 +44,7 @@ async def get_author(_, _info, slug='', author_id=None):
|
||||||
author = None
|
author = None
|
||||||
try:
|
try:
|
||||||
if slug:
|
if slug:
|
||||||
q = select(Author).select_from(Author).filter(Author.slug == slug)
|
[author_id] = local_session().execute(Author.id).filter(Author.slug == slug).scalar()
|
||||||
result = await get_authors_with_stat_cached(q)
|
|
||||||
if result:
|
|
||||||
[author] = result
|
|
||||||
author_id = author.id
|
|
||||||
|
|
||||||
if author_id:
|
if author_id:
|
||||||
cache_key = f'author:{author_id}'
|
cache_key = f'author:{author_id}'
|
||||||
cache = await redis.execute('GET', cache_key)
|
cache = await redis.execute('GET', cache_key)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user