fix: render pipeline + multi-tenancy bugs (B-Fix-1 through B-Fix-9)
- Remove worker-thumbnail (no Blender, was competing on thumbnail_rendering) - Move render_order_line_task to thumbnail_rendering queue (render-worker) - Restore template_service.py real implementation (fix circular import shim) - Thread tenant_id through STEP upload, Excel import, product create - Make system tables (output_types, materials, etc.) tenant_id nullable - Fix tenants frontend 307-redirect: use trailing slash /tenants/ - Remove Flamenco + Three.js from Admin UI (unsupported) - Set all output_types render_backend to celery (was flamenco) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,7 @@ async def lookup_product(
|
||||
|
||||
|
||||
async def lookup_or_create_product(
|
||||
db: AsyncSession, pim_id: str | None, fields: dict
|
||||
db: AsyncSession, pim_id: str | None, fields: dict, tenant_id=None
|
||||
) -> tuple[Product, bool]:
|
||||
"""Look up by produkt_baureihe (primary), then pim_id (fallback). Create if not found.
|
||||
|
||||
@@ -120,6 +120,7 @@ async def lookup_or_create_product(
|
||||
components=fields.get("components", []),
|
||||
cad_part_materials=fields.get("cad_part_materials", []),
|
||||
source_excel=fields.get("source_excel"),
|
||||
tenant_id=tenant_id,
|
||||
)
|
||||
db.add(product)
|
||||
await db.flush()
|
||||
|
||||
@@ -110,9 +110,7 @@ def dispatch_render_with_workflow(order_line_id: str) -> dict:
|
||||
|
||||
|
||||
def _legacy_dispatch(order_line_id: str) -> dict:
|
||||
"""Delegate to the original render_dispatcher logic (kept for backward compat)."""
|
||||
# Import the original full implementation (not the shim) to avoid circular imports.
|
||||
# The original logic lives inline in the orders router / step_tasks path;
|
||||
# here we re-use the existing flamenco/celery routing code.
|
||||
from app.services.render_dispatcher import dispatch_render # noqa: F401 — shim re-export
|
||||
return dispatch_render(order_line_id)
|
||||
"""Queue render_order_line_task (the working Celery render implementation)."""
|
||||
from app.tasks.step_tasks import render_order_line_task
|
||||
render_order_line_task.delay(order_line_id)
|
||||
return {"backend": "celery", "queued": True}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Rendering services — template resolution, dispatch, and Blender utilities."""
|
||||
|
||||
# Re-export from original service files for backward compatibility.
|
||||
# Re-export from canonical service files for backward compatibility.
|
||||
# template_service contains the actual sync implementations (Celery-safe).
|
||||
from app.services.template_service import resolve_template, get_material_library_path
|
||||
from app.services.render_dispatcher import dispatch_render
|
||||
from app.services.render_blender import find_blender, is_blender_available
|
||||
|
||||
Reference in New Issue
Block a user