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

@@ -19,6 +19,12 @@ from services.env import EnvVariable, env_manager
from settings import ADMIN_EMAILS as ADMIN_EMAILS_LIST
from utils.logger import root_logger as logger
# Отложенный импорт Author для избежания циклических импортов
def get_author_model():
"""Возвращает модель Author для использования в admin"""
from auth.orm import Author
return Author
class AdminService:
"""Сервис для админ-панели с бизнес-логикой"""
@@ -53,6 +59,7 @@ class AdminService:
"slug": "system",
}
Author = get_author_model()
author = session.query(Author).where(Author.id == author_id).first()
if author:
return {
@@ -69,7 +76,7 @@ class AdminService:
}
@staticmethod
def get_user_roles(user: Author, community_id: int = 1) -> list[str]:
def get_user_roles(user: Any, community_id: int = 1) -> list[str]:
"""Получает роли пользователя в сообществе"""
admin_emails = ADMIN_EMAILS_LIST.split(",") if ADMIN_EMAILS_LIST else []