Fix post-row link on 404: inject Jinja globals into error context
base_context() doesn't include blog_url/cart_url/etc — those live in Jinja globals. Without them call_url(ctx, "blog_url", ...) falls back to a relative path instead of https://blog.rose-ash.com/... Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -94,6 +94,12 @@ async def _rich_error_page(errnum: str, message: str, image: str | None = None)
|
||||
except Exception:
|
||||
ctx = {"base_title": "Rose Ash", "asset_url": "/static"}
|
||||
|
||||
# Inject Jinja globals (blog_url, cart_url, etc.) — these are
|
||||
# needed by call_url() for cross-subdomain links.
|
||||
for key, val in current_app.jinja_env.globals.items():
|
||||
if key not in ctx:
|
||||
ctx[key] = val
|
||||
|
||||
# Try to fetch fragments, but don't fail if they're unreachable
|
||||
try:
|
||||
from shared.infrastructure.fragments import fetch_fragments
|
||||
|
||||
Reference in New Issue
Block a user