From 385785f55e34160ddab06d407c4b9211ef752037 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Fri, 25 Nov 2022 12:20:08 +0100 Subject: [PATCH 1/2] CORS any localhost port --- nginx.conf.sigil | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx.conf.sigil b/nginx.conf.sigil index aa224351..8de054e7 100644 --- a/nginx.conf.sigil +++ b/nginx.conf.sigil @@ -5,7 +5,7 @@ {{ $upstream_port := index $port_map_list 2 }} map $http_origin $allow_origin { - ~^https?:\/\/((.*\.)?localhost:3000|discoursio-webapp(-(.*))?\.vercel\.app|(.*\.)?discours\.io)$ $http_origin; + ~^https?:\/\/((.*\.)?localhost(:\d+)?|discoursio-webapp(-(.*))?\.vercel\.app|(.*\.)?discours\.io)$ $http_origin; default ""; } From 399ef2a13ed5a86b11bdbbc582c6133be4733a68 Mon Sep 17 00:00:00 2001 From: Igor Lobanov Date: Fri, 25 Nov 2022 12:52:14 +0100 Subject: [PATCH 2/2] profile fix --- resolvers/zine/profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resolvers/zine/profile.py b/resolvers/zine/profile.py index de4041c1..d0e9d3af 100644 --- a/resolvers/zine/profile.py +++ b/resolvers/zine/profile.py @@ -184,7 +184,7 @@ async def get_authors_all(_, _info): @query.field("getAuthor") async def get_author(_, _info, slug): with local_session() as session: - author = session.query(User).join(ShoutAuthor).where(User.slug == slug).first() + author = session.query(User).where(User.slug == slug).first() author.stat = await get_author_stat(author.slug) return author