Enforce partner client ownership and partner-scoped imports
This commit is contained in:
@@ -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}")
|
||||
|
||||
Reference in New Issue
Block a user