From ec7f82c72fcc8c9542561ad8e6bd812d05c36ef8 Mon Sep 17 00:00:00 2001 From: tonyrewin Date: Wed, 16 Nov 2022 19:39:54 +0300 Subject: [PATCH] authorsall-fix --- auth/oauth.py | 2 +- resolvers/profile.py | 3 +-- schema.graphql | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/auth/oauth.py b/auth/oauth.py index ac63fa5a..88950c8d 100644 --- a/auth/oauth.py +++ b/auth/oauth.py @@ -66,7 +66,7 @@ async def oauth_login(request): provider = request.path_params["provider"] request.session["provider"] = provider client = oauth.create_client(provider) - redirect_uri = "https://newapi.discours.io/oauth-authorize" + redirect_uri = "https://v2.discours.io/oauth-authorize" return await client.authorize_redirect(request, redirect_uri) diff --git a/resolvers/profile.py b/resolvers/profile.py index 85eaa9e9..629d14e7 100644 --- a/resolvers/profile.py +++ b/resolvers/profile.py @@ -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 diff --git a/schema.graphql b/schema.graphql index 2ef60587..44e0ad1a 100644 --- a/schema.graphql +++ b/schema.graphql @@ -218,6 +218,7 @@ input ShoutsBy { topic: String topics: [String] author: String + authors: [String] layout: String visibility: String order: String