fixes-inbox-topics-authors

This commit is contained in:
2022-10-04 02:43:08 +03:00
parent 5c056525ed
commit e16265a0c3
3 changed files with 5 additions and 3 deletions

View File

@@ -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}")

View File

@@ -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]