stats-fix
This commit is contained in:
parent
f57719d182
commit
537d588853
|
@ -403,9 +403,8 @@ async def load_reactions_by(_, info, by, limit=50, offset=0):
|
|||
reaction.stat = {
|
||||
"rating": rating_stat,
|
||||
"commented": commented_stat,
|
||||
"reacted": reacted_stat,
|
||||
"reacted": reacted_stat
|
||||
}
|
||||
reaction.kind = reaction.kind.name
|
||||
reactions.append(reaction)
|
||||
|
||||
# sort if by stat is present
|
||||
|
|
|
@ -86,16 +86,15 @@ async def get_shout(_, _info, slug=None, shout_id=None):
|
|||
q = q.filter(Shout.deleted_at.is_(None)).group_by(Shout.id)
|
||||
|
||||
try:
|
||||
[
|
||||
shout,
|
||||
viewed_stat,
|
||||
reacted_stat,
|
||||
commented_stat,
|
||||
rating_stat,
|
||||
] = (
|
||||
session.execute(q).first() or []
|
||||
)
|
||||
if shout:
|
||||
author_stats = session.execute(q).first()
|
||||
if author_stats:
|
||||
[
|
||||
shout,
|
||||
viewed_stat,
|
||||
reacted_stat,
|
||||
commented_stat,
|
||||
rating_stat,
|
||||
] = author_stats
|
||||
shout.stat = {
|
||||
"viewed": viewed_stat,
|
||||
"reacted": reacted_stat,
|
||||
|
|
Loading…
Reference in New Issue
Block a user