fix(K): correct CATALOG_SCRIPT path + register AssetLibrary in models/__init__

- fix(tasks): use RENDER_SCRIPTS_DIR env var for catalog_assets.py path
  (was computing wrong path via __file__ parents → /render-worker/scripts/ which doesn't exist in container)
- fix(models): add AssetLibrary to app/models/__init__.py so alembic autogenerate discovers it
- fix(api): remove unused FileResponse import from asset_libraries.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-06 21:02:41 +01:00
parent a18d4c23ec
commit 3ac3ca1d70
3 changed files with 5 additions and 5 deletions
@@ -4,7 +4,6 @@ import shutil
from pathlib import Path
from fastapi import APIRouter, Depends, HTTPException, UploadFile, File, Form, status
from fastapi.responses import FileResponse
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from pydantic import BaseModel
+3 -2
View File
@@ -3,6 +3,7 @@ from __future__ import annotations
import json
import logging
import os
import subprocess
import uuid
from pathlib import Path
@@ -11,7 +12,8 @@ from celery import shared_task
logger = logging.getLogger(__name__)
CATALOG_SCRIPT = Path(__file__).parent.parent.parent.parent.parent / "render-worker" / "scripts" / "catalog_assets.py"
# Scripts are copied to /render-scripts/ in the render-worker container (RENDER_SCRIPTS_DIR env var)
CATALOG_SCRIPT = Path(os.environ.get("RENDER_SCRIPTS_DIR", "/render-scripts")) / "catalog_assets.py"
@shared_task(
@@ -48,7 +50,6 @@ def refresh_asset_library_catalog(self, asset_library_id: str) -> None:
return
# Determine Blender binary
import os
blender_bin = os.environ.get("BLENDER_BIN", "blender")
result = subprocess.run(
+2 -2
View File
@@ -11,7 +11,7 @@ from app.domains.orders.models import Order, OrderItem, OrderLine
from app.domains.notifications.models import AuditLog
from app.domains.billing.models import PricingTier
from app.domains.rendering.models import OutputType, RenderTemplate, ProductRenderPosition, WorkflowDefinition, WorkflowRun, WorkflowNodeResult
from app.domains.materials.models import Material, MaterialAlias
from app.domains.materials.models import Material, MaterialAlias, AssetLibrary
from app.domains.media.models import MediaAsset, MediaAssetType
# Also re-export SystemSetting (no domain assigned — stays as-is)
@@ -21,5 +21,5 @@ __all__ = [
"Tenant", "User", "Template", "CadFile", "Product", "Order", "OrderItem", "OrderLine",
"AuditLog", "PricingTier", "OutputType", "RenderTemplate", "ProductRenderPosition",
"WorkflowDefinition", "WorkflowRun", "WorkflowNodeResult",
"Material", "MaterialAlias", "MediaAsset", "MediaAssetType", "SystemSetting",
"Material", "MaterialAlias", "AssetLibrary", "MediaAsset", "MediaAssetType", "SystemSetting",
]