This commit is contained in:
@@ -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 []
|
||||
|
||||
Reference in New Issue
Block a user