From 937b154c6b86938a05f308393cc826f682176c1a Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 17 Apr 2024 18:31:11 +0300 Subject: [PATCH] family-name-fix --- pyproject.toml | 4 ++++ services/webhook.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3c2fc354..5e198f6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,3 +31,7 @@ isort = "^5.13.2" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[tool.pyright] +venvPath = "." +venv = ".venv" diff --git a/services/webhook.py b/services/webhook.py index 5b3da279..cffc8939 100644 --- a/services/webhook.py +++ b/services/webhook.py @@ -27,10 +27,10 @@ class WebhookEndpoint(HTTPEndpoint): raise HTTPException( status_code=400, detail='User data is not a dictionary' ) - user_id: str = user.get('id') + user_id: str = user.get('id', '') name: str = ( f"{user.get('given_name', user.get('slug'))} {user.get('middle_name', '')}" - + "{user.get('family_name', '')}".strip() + + f"{user.get('family_name', '')}".strip() ) or 'Аноним' email: str = user.get('email', '') pic: str = user.get('picture', '')