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
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user