Fix cart route missing slug param (popped by app-level preprocessor)
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 57s

App-level url_value_preprocessor pops slug from values, so the
product blueprint's cart() never receives it. Use g.product_slug
(set by resolve_product before_request) instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-24 09:51:50 +00:00
parent 4a37f281d4
commit 3c9ff1210a

View File

@@ -159,7 +159,8 @@ def register():
@bp.post("/cart/")
@clear_cache(tag="browse", tag_scope="user")
async def cart(slug: str):
async def cart(**_kw):
slug = g.product_slug
# make sure product exists (we *allow* deleted_at != None later if you want)
product_id = await g.s.scalar(
select(Product.id).where(