fix: remove broken dev_tools router references after API route migration
The dev_tools API routes were moved to the monitoring module, but several files still tried to import the non-existent admin_router. This caused warnings during app startup. Changes: - Remove _get_admin_router() from definition.py - Clear routes/__init__.py and routes/api/__init__.py of broken imports - Update exceptions.py to import from monitoring.exceptions - Update code_quality_service.py to import from monitoring.exceptions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,14 +16,9 @@ from app.modules.base import ModuleDefinition
|
||||
from models.database.admin_menu_config import FrontendType
|
||||
|
||||
|
||||
def _get_admin_router():
|
||||
"""Lazy import of admin router to avoid circular imports."""
|
||||
from app.modules.dev_tools.routes.api.admin import admin_router
|
||||
|
||||
return admin_router
|
||||
|
||||
|
||||
# Dev-Tools module definition
|
||||
# Note: API routes (code quality, tests) have been moved to monitoring module.
|
||||
# This module retains models, services, and page routes only.
|
||||
dev_tools_module = ModuleDefinition(
|
||||
code="dev-tools",
|
||||
name="Developer Tools",
|
||||
@@ -81,13 +76,13 @@ dev_tools_module = ModuleDefinition(
|
||||
|
||||
def get_dev_tools_module_with_routers() -> ModuleDefinition:
|
||||
"""
|
||||
Get dev-tools module with routers attached.
|
||||
Get dev-tools module definition.
|
||||
|
||||
This function attaches the routers lazily to avoid circular imports
|
||||
during module initialization.
|
||||
Note: API routes have been moved to monitoring module.
|
||||
This module has no routers to attach.
|
||||
"""
|
||||
dev_tools_module.admin_router = _get_admin_router()
|
||||
# No vendor router for internal modules
|
||||
# No routers - API routes are now in monitoring module
|
||||
dev_tools_module.admin_router = None
|
||||
dev_tools_module.vendor_router = None
|
||||
return dev_tools_module
|
||||
|
||||
|
||||
Reference in New Issue
Block a user