fixes-inbox-topics-authors
This commit is contained in:
@@ -74,7 +74,7 @@ async def add_user_to_chat(user_slug, chat_id, chat=None):
|
||||
await redis.execute("SET", f"chats/{chat_id}", json.dumps(chat))
|
||||
|
||||
|
||||
@mutation.query("inviteChat")
|
||||
@mutation.field("inviteChat")
|
||||
async def invite_to_chat(_, info, invited, chat_id):
|
||||
user = info.context["request"].user
|
||||
chat = await redis.execute("GET", f"chats/{chat_id}")
|
||||
|
@@ -130,6 +130,7 @@ async def shouts_by_authors(_, _info, slugs, offset, limit):
|
||||
for a in s.authors:
|
||||
a.caption = await ShoutAuthorStorage.get_author_caption(s.slug, a.slug)
|
||||
shouts_prepared.append(s)
|
||||
shouts_prepared = list(set(shouts_prepared))
|
||||
shouts_prepared.sort(key=lambda s: s.publishedAt, reverse=True)
|
||||
return shouts_prepared[offset : offset + limit]
|
||||
|
||||
@@ -146,6 +147,7 @@ async def shouts_by_topics(_, _info, slugs, offset, limit):
|
||||
for a in s.authors:
|
||||
a.caption = await ShoutAuthorStorage.get_author_caption(s.slug, a.slug)
|
||||
shouts_prepared.append(s)
|
||||
shouts_prepared = list(set(shouts_prepared))
|
||||
shouts_prepared.sort(key=lambda s: s.publishedAt, reverse=True)
|
||||
return shouts_prepared[offset : offset + limit]
|
||||
|
||||
|
Reference in New Issue
Block a user