This commit is contained in:
parent
41d8253094
commit
2939cd8adc
|
@ -95,8 +95,8 @@ async def create_draft(_, info, draft_input):
|
||||||
|
|
||||||
# Проверяем обязательные поля
|
# Проверяем обязательные поля
|
||||||
if "body" not in draft_input or not draft_input["body"]:
|
if "body" not in draft_input or not draft_input["body"]:
|
||||||
draft_input["body"] = "" # Пустая строка вместо NULL
|
draft_input["body"] = "" # Пустая строка вместо NULL
|
||||||
|
|
||||||
try:
|
try:
|
||||||
with local_session() as session:
|
with local_session() as session:
|
||||||
# Remove id from input if present since it's auto-generated
|
# 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_input["created_at"] = int(time.time())
|
||||||
|
|
||||||
draft = Draft(created_by=author_id, **draft_input)
|
draft = Draft(created_by=author_id, **draft_input)
|
||||||
session.add(draft)
|
session.add(draft)
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
25
resolvers/pyrightconfig.json
Normal file
25
resolvers/pyrightconfig.json
Normal file
|
@ -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
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user