This commit is contained in:
parent
53a0f2e328
commit
3b0aedf959
|
@ -96,8 +96,8 @@ async def load_shout(_, _info, slug=None, shout_id=None):
|
|||
commented_stat,
|
||||
rating_stat,
|
||||
_last_comment,
|
||||
] = session.execute(q).first()
|
||||
|
||||
] = session.execute(q).first() or []
|
||||
if shout:
|
||||
shout.stat = {
|
||||
"viewed": viewed_stat,
|
||||
"reacted": reacted_stat,
|
||||
|
@ -149,13 +149,11 @@ async def load_shouts_by(_, info, options):
|
|||
|
||||
q = add_stat_columns(q)
|
||||
|
||||
user_id = info.context["user_id"]
|
||||
filters = options.get("filters")
|
||||
if filters:
|
||||
with local_session() as session:
|
||||
author = session.query(Author).filter(Author.user == user_id).first()
|
||||
if author:
|
||||
q = apply_filters(q, filters, author.id)
|
||||
# TODO: some filtering logix?
|
||||
pass
|
||||
|
||||
order_by = options.get("order_by", Shout.published_at)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user