fix: skip custom domain store detection for platform domains
Some checks failed
Some checks failed
StoreContextMiddleware was treating platform domains (e.g. rewardflow.lu) as custom store domains, causing store lookup to fail before reaching path-based detection (/storefront/FASHIONHUB/...). Now skips custom domain detection when the host matches the platform's own domain. Also fixes menu tests to use loyalty-program instead of loyalty-overview, and adds LOYALTY_DEFAULT_LOGO_URL and LOYALTY_GOOGLE_WALLET_ORIGINS to Hetzner deployment docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,8 +59,17 @@ class StoreContextManager:
|
||||
# Check if this is a custom domain (not platform.com and not localhost)
|
||||
platform_domain = getattr(settings, "platform_domain", "platform.com")
|
||||
|
||||
# Skip custom domain detection if host is already a platform domain
|
||||
# (e.g. rewardflow.lu is the loyalty platform, not a store)
|
||||
platform = getattr(request.state, "platform", None)
|
||||
is_platform_domain = (
|
||||
platform and getattr(platform, "domain", None)
|
||||
and host == platform.domain
|
||||
)
|
||||
|
||||
is_custom_domain = (
|
||||
host
|
||||
and not is_platform_domain
|
||||
and not host.endswith(f".{platform_domain}")
|
||||
and host != platform_domain
|
||||
and host
|
||||
|
||||
Reference in New Issue
Block a user