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

@@ -1,17 +1,14 @@
from typing import TYPE_CHECKING, Any, TypeVar
from typing import Any, TypeVar
from auth.exceptions import ExpiredTokenError, InvalidPasswordError, InvalidTokenError
from auth.jwtcodec import JWTCodec
from auth.orm import Author
from auth.password import Password
from services.db import local_session
from services.redis import redis
from utils.logger import root_logger as logger
# Для типизации
if TYPE_CHECKING:
from auth.orm import Author
AuthorType = TypeVar("AuthorType", bound="Author")
AuthorType = TypeVar("AuthorType", bound=Author)
class Identity:
@@ -57,8 +54,7 @@ class Identity:
Returns:
Author: Объект пользователя
"""
# Поздний импорт для избежания циклических зависимостей
from auth.orm import Author
# Author уже импортирован в начале файла
with local_session() as session:
author = session.query(Author).where(Author.email == inp["email"]).first()
@@ -101,9 +97,7 @@ class Identity:
return {"error": "Token not found"}
# Если все проверки пройдены, ищем автора в базе данных
# Поздний импорт для избежания циклических зависимостей
from auth.orm import Author
# Author уже импортирован в начале файла
with local_session() as session:
author = session.query(Author).filter_by(id=user_id).first()
if not author: