refactor: rename platform_domain → main_domain to avoid confusion with platform.domain
Some checks failed
Some checks failed
The setting `settings.platform_domain` (the global/main domain like "wizard.lu") was easily confused with `platform.domain` (per-platform domain like "rewardflow.lu"). Renamed to `settings.main_domain` / `MAIN_DOMAIN` env var across the entire codebase. Also updated docs to reflect the refactored store detection logic with `is_platform_domain` / `is_subdomain_of_platform` guards. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -335,19 +335,19 @@ class Store(Base, TimestampMixin):
|
||||
Domain Resolution Priority:
|
||||
1. Store-specific custom domain (StoreDomain) -> highest priority
|
||||
2. Merchant domain (MerchantDomain) -> inherited default
|
||||
3. Store subdomain ({store.subdomain}.{platform_domain}) -> fallback
|
||||
3. Store subdomain ({store.subdomain}.{main_domain}) -> fallback
|
||||
"""
|
||||
if self.primary_domain:
|
||||
return self.primary_domain
|
||||
if self.merchant and self.merchant.primary_domain:
|
||||
return self.merchant.primary_domain
|
||||
return f"{self.subdomain}.{settings.platform_domain}"
|
||||
return f"{self.subdomain}.{settings.main_domain}"
|
||||
|
||||
@property
|
||||
def all_domains(self):
|
||||
"""Get all active domains (subdomain + custom domains)."""
|
||||
domains = [
|
||||
f"{self.subdomain}.{settings.platform_domain}"
|
||||
f"{self.subdomain}.{settings.main_domain}"
|
||||
] # Start with the main subdomain
|
||||
for domain in self.domains:
|
||||
if domain.is_active:
|
||||
|
||||
Reference in New Issue
Block a user