stat-resolver-fix
All checks were successful
Deploy on push / deploy (push) Successful in 24s

This commit is contained in:
Untone 2024-04-24 10:30:32 +03:00
parent c1a66500e5
commit e90d5aefb2

View File

@ -178,20 +178,20 @@ def get_with_stat(q):
with local_session() as session: with local_session() as session:
result = session.execute(add_stat_handler(q)) result = session.execute(add_stat_handler(q))
for cols in result: for cols in result:
entity = cols[0] entity = cols[0]
stat = dict() stat = dict()
stat["shouts"] = cols[1] stat["shouts"] = cols[1]
stat["followers"] = cols[2] stat["followers"] = cols[2]
stat["authors"] = ( stat["authors"] = (
get_author_authors_stat(entity.id) get_author_authors_stat(entity.id)
if is_author if is_author
else get_topic_authors_stat(entity.id) else get_topic_authors_stat(entity.id)
) )
if is_author: if is_author:
stat["comments"] = get_author_comments_stat(entity.id) stat["comments"] = get_author_comments_stat(entity.id)
entity.stat = stat entity.stat = stat
records.append(entity) records.append(entity)
except Exception as exc: except Exception as exc:
logger.error(exc, exc_info=True) logger.error(exc, exc_info=True)
return records return records