Fix cart load_service_components path
The old sx_components.py used os.path.dirname(__file__) to resolve the app root. When it was deleted, the replacement call in app.py used the string "cart" which resolves to /app/cart/ (alembic only), not /app/ where the sx/ directory lives. Use Path(__file__).parent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -140,7 +140,8 @@ def create_app() -> "Quart":
|
||||
app.jinja_env.globals["cart_quantity_url"] = lambda product_id: f"/quantity/{product_id}/"
|
||||
app.jinja_env.globals["cart_delete_url"] = lambda product_id: f"/delete/{product_id}/"
|
||||
|
||||
load_service_components("cart")
|
||||
from pathlib import Path
|
||||
load_service_components(str(Path(__file__).resolve().parent), service_name="cart")
|
||||
|
||||
from shared.sx.handlers import auto_mount_fragment_handlers
|
||||
auto_mount_fragment_handlers(app, "cart")
|
||||
|
||||
Reference in New Issue
Block a user