author-id-fix

This commit is contained in:
Untone 2024-03-11 15:19:10 +03:00
parent b45ad1082d
commit 8b5a50b7ae

View File

@ -146,8 +146,8 @@ def load_authors_by(_, _info, by, limit, offset):
async def get_author_follows(_, _info, slug='', user=None, author_id=None): async def get_author_follows(_, _info, slug='', user=None, author_id=None):
with (local_session() as session): with (local_session() as session):
if user or slug: if user or slug:
author = session.query(Author).filter(or_(Author.user == user, Author.slug == slug)).first() author = session.query(Author).filter(or_(Author.user == user, Author.slug == slug)).first()
if author: if author:
author_id = author.id author_id = author.id
if author_id: if author_id:
rkey = f'author:{author_id}:follows-authors' rkey = f'author:{author_id}:follows-authors'