Fix Demo enterprise
This commit is contained in:
@@ -62,7 +62,8 @@ async def load_fixture_data_for_tenant(
|
||||
db: AsyncSession,
|
||||
tenant_uuid: UUID,
|
||||
demo_account_type: str,
|
||||
reference_time: datetime
|
||||
reference_time: datetime,
|
||||
base_tenant_id: Optional[str] = None
|
||||
) -> int:
|
||||
"""
|
||||
Load orchestration run data from JSON fixture directly into the virtual tenant.
|
||||
@@ -72,16 +73,10 @@ async def load_fixture_data_for_tenant(
|
||||
from shared.utils.demo_dates import resolve_time_marker, adjust_date_for_demo
|
||||
|
||||
# Load fixture data
|
||||
try:
|
||||
if demo_account_type == "enterprise_child" and base_tenant_id:
|
||||
json_file = get_seed_data_path("enterprise", "11-orchestrator.json", child_id=base_tenant_id)
|
||||
else:
|
||||
json_file = get_seed_data_path(demo_account_type, "11-orchestrator.json")
|
||||
except ImportError:
|
||||
# Fallback to original path
|
||||
seed_data_dir = Path(__file__).parent.parent.parent.parent / "shared" / "demo" / "fixtures"
|
||||
json_file = seed_data_dir / demo_account_type / "11-orchestrator.json"
|
||||
|
||||
if not json_file.exists():
|
||||
logger.warning("Orchestrator fixture file not found", file=str(json_file))
|
||||
return 0
|
||||
|
||||
with open(json_file, 'r', encoding='utf-8') as f:
|
||||
fixture_data = json.load(f)
|
||||
@@ -206,7 +201,8 @@ async def clone_demo_data(
|
||||
db,
|
||||
virtual_uuid,
|
||||
demo_account_type,
|
||||
reference_time
|
||||
reference_time,
|
||||
base_tenant_id
|
||||
)
|
||||
|
||||
await db.commit()
|
||||
|
||||
Reference in New Issue
Block a user