Enforce partner client ownership and partner-scoped imports

This commit is contained in:
A R R R Associates
2026-07-29 06:05:10 +05:30
parent 83f4cd2d4f
commit a58ec7b807
9 changed files with 205 additions and 108 deletions
+3 -15
View File
@@ -1,29 +1,17 @@
"""Clients module.
"""Clients module with lazy router exports.
Routers are exposed lazily so importing ``app.modules.clients.models`` does
not initialise the clients API, UI, importer, and related modules. This keeps
the existing ``api_router`` and ``ui_router`` public exports while preventing
circular imports with client groups.
Importing client models must not initialise the complete UI/import stack.
"""
from __future__ import annotations
from typing import Any
__all__ = ["api_router", "ui_router"]
def __getattr__(name: str) -> Any:
if name == "api_router":
from .api import router
return router
if name == "ui_router":
from .ui import router
return router
raise AttributeError(
f"module {__name__!r} has no attribute {name!r}"
)
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")