Rename product blueprint URL param slug → product_slug
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 57s

The app-level url_value_preprocessor pops "slug" and "page_slug"
into g.post_slug, with page_slug overwriting the product slug.
Renaming the blueprint param to product_slug eliminates the
collision entirely. Views now use g.product_slug (set by blueprint
preprocessor) and have clean signatures with no **_kw hacks.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-24 10:25:00 +00:00
parent 291c829c7f
commit d92d4840ed
3 changed files with 24 additions and 33 deletions

View File

@@ -7,9 +7,9 @@
{% if not quantity %}
<form
action="{{ url_for('market.browse.product.cart', slug=slug) }}"
action="{{ url_for('market.browse.product.cart', product_slug=slug) }}"
method="post"
hx-post="{{ url_for('market.browse.product.cart', slug=slug) }}"
hx-post="{{ url_for('market.browse.product.cart', product_slug=slug) }}"
hx-target="#cart-mini"
hx-swap="outerHTML"
class="rounded flex items-center"
@@ -38,9 +38,9 @@
<div class="rounded flex items-center gap-2">
<!-- minus -->
<form
action="{{ url_for('market.browse.product.cart', slug=slug) }}"
action="{{ url_for('market.browse.product.cart', product_slug=slug) }}"
method="post"
hx-post="{{ url_for('market.browse.product.cart', slug=slug) }}"
hx-post="{{ url_for('market.browse.product.cart', product_slug=slug) }}"
hx-target="#cart-mini"
hx-swap="outerHTML"
>
@@ -80,9 +80,9 @@
<!-- plus -->
<form
action="{{ url_for('market.browse.product.cart', slug=slug) }}"
action="{{ url_for('market.browse.product.cart', product_slug=slug) }}"
method="post"
hx-post="{{ url_for('market.browse.product.cart', slug=slug) }}"
hx-post="{{ url_for('market.browse.product.cart', product_slug=slug) }}"
hx-target="#cart-mini"
hx-swap="outerHTML"
>
@@ -139,7 +139,7 @@
<div class="flex flex-col sm:flex-row sm:items-start justify-between gap-2 sm:gap-3">
<div class="min-w-0">
<h2 class="text-sm sm:text-base md:text-lg font-semibold text-stone-900">
{% set href=url_for('market.browse.product.product_detail', slug=p.slug) %}
{% set href=url_for('market.browse.product.product_detail', product_slug=p.slug) %}
<a
href="{{ href }}"
hx_get="{{href}}"
@@ -189,9 +189,9 @@
<div class="flex items-center gap-2 text-xs sm:text-sm text-stone-700">
<span class="text-[0.65rem] sm:text-xs uppercase tracking-wide text-stone-500">Quantity</span>
<form
action="{{ url_for('market.browse.product.cart', slug=p.slug) }}"
action="{{ url_for('market.browse.product.cart', product_slug=p.slug) }}"
method="post"
hx-post="{{ url_for('market.browse.product.cart', slug=p.slug) }}"
hx-post="{{ url_for('market.browse.product.cart', product_slug=p.slug) }}"
hx-target="#cart-mini"
hx-swap="outerHTML"
>
@@ -212,9 +212,9 @@
{{ item.quantity }}
</span>
<form
action="{{ url_for('market.browse.product.cart', slug=p.slug) }}"
action="{{ url_for('market.browse.product.cart', product_slug=p.slug) }}"
method="post"
hx-post="{{ url_for('market.browse.product.cart', slug=p.slug) }}"
hx-post="{{ url_for('market.browse.product.cart', product_slug=p.slug) }}"
hx-target="#cart-mini"
hx-swap="outerHTML"
>