This commit is contained in:
parent
154477e1ad
commit
0874794140
|
@ -220,12 +220,13 @@ def get_shouts_with_links(info, q, limit=20, offset=0):
|
||||||
"slug": a.slug,
|
"slug": a.slug,
|
||||||
"pic": a.pic,
|
"pic": a.pic,
|
||||||
}
|
}
|
||||||
# logger.info({ **shout_dict, "body": "", "media": []})
|
if hasattr(row, "stat") and isinstance(row.stat, dict):
|
||||||
stat = json.loads(row.stat) if hasattr(row, "stat") else {}
|
viewed = ViewedStorage.get_shout(shout_id=shout_id) or 0
|
||||||
viewed = ViewedStorage.get_shout(shout_id=shout_id) or 0
|
shout_dict["stat"] = {
|
||||||
stat["viewed"] = viewed
|
**row.stat,
|
||||||
if stat:
|
"viewed": viewed,
|
||||||
shout_dict["stat"] = {**stat, "commented": stat.get("comments_count", 0)}
|
"commented": row.stat.get("comments_count", 0)
|
||||||
|
}
|
||||||
|
|
||||||
if has_field(info, "main_topic") and hasattr(row, "main_topic"):
|
if has_field(info, "main_topic") and hasattr(row, "main_topic"):
|
||||||
shout_dict["main_topic"] = json.loads(row.main_topic)
|
shout_dict["main_topic"] = json.loads(row.main_topic)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user