From 2939cd8adc073fc749c26a78c650bed38c00c001 Mon Sep 17 00:00:00 2001 From: Untone Date: Wed, 19 Feb 2025 00:21:51 +0300 Subject: [PATCH] pyright-conf --- resolvers/draft.py | 6 +++--- resolvers/pyrightconfig.json | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 resolvers/pyrightconfig.json diff --git a/resolvers/draft.py b/resolvers/draft.py index c669bee5..1d9fd17a 100644 --- a/resolvers/draft.py +++ b/resolvers/draft.py @@ -95,8 +95,8 @@ async def create_draft(_, info, draft_input): # Проверяем обязательные поля if "body" not in draft_input or not draft_input["body"]: - draft_input["body"] = "" # Пустая строка вместо NULL - + draft_input["body"] = "" # Пустая строка вместо NULL + try: with local_session() as session: # Remove id from input if present since it's auto-generated @@ -105,7 +105,7 @@ async def create_draft(_, info, draft_input): # Добавляем текущее время создания draft_input["created_at"] = int(time.time()) - + draft = Draft(created_by=author_id, **draft_input) session.add(draft) session.commit() diff --git a/resolvers/pyrightconfig.json b/resolvers/pyrightconfig.json new file mode 100644 index 00000000..c3d0f5cf --- /dev/null +++ b/resolvers/pyrightconfig.json @@ -0,0 +1,25 @@ +{ + "include": [ + "." + ], + "exclude": [ + "**/node_modules", + "**/__pycache__", + "**/.*" + ], + "defineConstant": { + "DEBUG": true + }, + "venvPath": ".", + "venv": ".venv", + "pythonVersion": "3.11", + "typeCheckingMode": "strict", + "reportMissingImports": true, + "reportMissingTypeStubs": false, + "reportUnknownMemberType": false, + "reportUnknownParameterType": false, + "reportUnknownVariableType": false, + "reportUnknownArgumentType": false, + "reportPrivateUsage": false, + "reportUntypedFunctionDecorator": false +} \ No newline at end of file