From 4a837c652695f57928f541d51b1f526b1c4a5788 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Fri, 21 Oct 2022 02:17:11 +0300 Subject: [PATCH] actually authors, not users --- migration/tables/replacements.json | 4 ++-- resolvers/profile.py | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/migration/tables/replacements.json b/migration/tables/replacements.json index 8344d29c..36337a29 100644 --- a/migration/tables/replacements.json +++ b/migration/tables/replacements.json @@ -637,7 +637,7 @@ "sekond-hend": "second-hand", "seksprosvet": "sex-education", "seksualizirovannoe-nasilie": "sexualized-violence", - "seksualnoe-nasilie": "sexual-violence", + "seksualnoe-nasilie": "sexualized-violence", "sekty": "sects", "semi": "semi", "semiotics": "semiotics", @@ -701,7 +701,7 @@ "tataro-mongolskoe-igo": "mongol-tatar-yoke", "tatuirovki": "tattoo", "technology": "technology", - "televidenie": "tv", + "televidenie": "television", "telo": "body", "telo-kak-iskusstvo": "body-as-art", "terrorizm": "terrorism", diff --git a/resolvers/profile.py b/resolvers/profile.py index dec1235c..10fc03f9 100644 --- a/resolvers/profile.py +++ b/resolvers/profile.py @@ -15,6 +15,7 @@ from .inbox import get_unread_counter from .reactions import get_reactions_for_shouts from .topics import get_topic_stat from services.auth.users import UserStorage +from services.zine.shoutauthor import ShoutAuthorStorage async def get_user_subscriptions(slug): @@ -189,6 +190,8 @@ def author_unfollow(user, slug): @query.field("authorsAll") async def get_authors_all(_, _info): authors = await UserStorage.get_all_users() + authorslugs = await ShoutAuthorStorage.get_authors() + authors = filter(lambda a: a.emailConfirmed and a.slug in authorslugs, authors) for author in authors: author.stat = await get_author_stat(author.slug) return authors