authorsall-fix

This commit is contained in:
2022-11-16 19:39:54 +03:00
parent 074f4710f9
commit ec7f82c72f
3 changed files with 3 additions and 3 deletions

View File

@@ -175,10 +175,9 @@ def author_unfollow(user, slug):
@query.field("authorsAll")
async def get_authors_all(_, _info):
users = await UserStorage.get_all_users()
authorslugs = ShoutAuthorStorage.shouts_by_author.keys()
authors = []
for author in users:
if author.slug in authorslugs:
if ShoutAuthorStorage.shouts_by_author.get(author.slug):
author.stat = await get_author_stat(author.slug)
authors.append(author)
return authors