From ef25ebc7bcf6040de20dc13f1c4adc9db184b4b9 Mon Sep 17 00:00:00 2001 From: Untone Date: Mon, 4 Mar 2024 21:08:01 +0300 Subject: [PATCH] result-fix-2 --- resolvers/editor.py | 2 +- services/webhook.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/resolvers/editor.py b/resolvers/editor.py index 929793ed..43a94e8b 100644 --- a/resolvers/editor.py +++ b/resolvers/editor.py @@ -218,7 +218,7 @@ async def update_shout(_, info, shout_id, shout_input=None, publish=False): return {'error': 'shout not found'} if ( shout.created_by != author.id - and not shout.authors.contains(author.id) + and not filter(lambda x: x == author.id, shout.authors) and 'editor' not in roles ): return {'error': 'access denied'} diff --git a/services/webhook.py b/services/webhook.py index 5e128677..7d731e64 100644 --- a/services/webhook.py +++ b/services/webhook.py @@ -8,7 +8,6 @@ from starlette.exceptions import HTTPException from orm.author import Author from services.db import local_session -from services.logger import root_logger as logger class WebhookEndpoint(HTTPEndpoint): @@ -20,7 +19,7 @@ class WebhookEndpoint(HTTPEndpoint): auth = request.headers.get('Authorization') if not auth or auth != os.environ.get('WEBHOOK_SECRET'): raise HTTPException(status_code=401, detail="Invalid Authorization header") - logger.debug(data) + # logger.debug(data) user = data.get('user') if not isinstance(user, dict): raise HTTPException(status_code=400, detail="User data is not a dictionary")