get_author-follows-debug
All checks were successful
Deploy on push / deploy (push) Successful in 22s
All checks were successful
Deploy on push / deploy (push) Successful in 22s
This commit is contained in:
parent
e2faec5893
commit
95c54ff0c4
|
@ -163,6 +163,7 @@ def load_authors_by(_, _info, by, limit, offset):
|
|||
|
||||
@query.field('get_author_follows')
|
||||
async def get_author_follows(_, _info, slug='', user=None, author_id=0):
|
||||
try:
|
||||
author_query = select(Author)
|
||||
if user:
|
||||
author_query = author_query.filter(Author.user == user)
|
||||
|
@ -173,6 +174,7 @@ async def get_author_follows(_, _info, slug='', user=None, author_id=0):
|
|||
else:
|
||||
raise ValueError('One of slug, user, or author_id must be provided')
|
||||
[author] = local_session().execute(author_query)
|
||||
logger.debug(author.dict())
|
||||
if isinstance(author, Author):
|
||||
author_id = author.id.scalar()
|
||||
rkey = f'author:{author_id}:follows-authors'
|
||||
|
@ -202,6 +204,10 @@ async def get_author_follows(_, _info, slug='', user=None, author_id=0):
|
|||
}
|
||||
else:
|
||||
raise ValueError('Author not found')
|
||||
except Exception:
|
||||
import traceback
|
||||
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
@query.field('get_author_follows_topics')
|
||||
|
|
Loading…
Reference in New Issue
Block a user