circular-fix
Some checks failed
Deploy on push / deploy (push) Failing after 17s

This commit is contained in:
2025-08-17 16:33:54 +03:00
parent bc8447a444
commit e78e12eeee
65 changed files with 3304 additions and 1051 deletions

View File

@@ -3,7 +3,7 @@ from typing import Any
from graphql.error import GraphQLError
from auth.orm import Author
# Импорт Author отложен для избежания циклических импортов
from orm.community import Community
from orm.draft import Draft
from orm.reaction import Reaction
@@ -11,6 +11,12 @@ from orm.shout import Shout
from orm.topic import Topic
from utils.logger import root_logger as logger
# Отложенный импорт Author для избежания циклических импортов
def get_author_model():
"""Возвращает модель Author для использования в common_result"""
from auth.orm import Author
return Author
def handle_error(operation: str, error: Exception) -> GraphQLError:
"""Обрабатывает ошибки в резолверах"""
@@ -28,8 +34,8 @@ class CommonResult:
slugs: list[str] | None = None
shout: Shout | None = None
shouts: list[Shout] | None = None
author: Author | None = None
authors: list[Author] | None = None
author: Any | None = None # Author type resolved at runtime
authors: list[Any] | None = None # Author type resolved at runtime
reaction: Reaction | None = None
reactions: list[Reaction] | None = None
topic: Topic | None = None