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:
@@ -43,7 +43,7 @@ class TestStoreContextManager:
|
||||
request.url = Mock(path="/")
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -59,7 +59,7 @@ class TestStoreContextManager:
|
||||
request.url = Mock(path="/")
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -75,7 +75,7 @@ class TestStoreContextManager:
|
||||
request.url = Mock(path="/")
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -91,7 +91,7 @@ class TestStoreContextManager:
|
||||
request.url = Mock(path="/")
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -155,7 +155,7 @@ class TestStoreContextManager:
|
||||
request.state.platform_clean_path = None
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -170,7 +170,7 @@ class TestStoreContextManager:
|
||||
request.state.platform_clean_path = None
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -185,7 +185,7 @@ class TestStoreContextManager:
|
||||
request.state.platform_clean_path = None
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -200,7 +200,7 @@ class TestStoreContextManager:
|
||||
request.state.platform_clean_path = None
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
@@ -441,7 +441,7 @@ class TestStoreContextManager:
|
||||
request.headers = {"referer": "http://orion.platform.com/storefront/products"} # noqa: SEC034
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.extract_store_from_referer(request)
|
||||
|
||||
@@ -456,7 +456,7 @@ class TestStoreContextManager:
|
||||
request.headers = {"referer": "http://my-custom-shop.com/storefront/products"} # noqa: SEC034
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.extract_store_from_referer(request)
|
||||
|
||||
@@ -490,7 +490,7 @@ class TestStoreContextManager:
|
||||
request.headers = {"referer": "http://admin.platform.com/dashboard"} # noqa: SEC034
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.extract_store_from_referer(request)
|
||||
|
||||
@@ -503,7 +503,7 @@ class TestStoreContextManager:
|
||||
request.headers = {"referer": "http://www.platform.com/storefront"} # noqa: SEC034
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.extract_store_from_referer(request)
|
||||
|
||||
@@ -515,7 +515,7 @@ class TestStoreContextManager:
|
||||
request.headers = {"referer": "http://localhost:8000/storefront"}
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.extract_store_from_referer(request)
|
||||
|
||||
@@ -996,7 +996,7 @@ class TestEdgeCases:
|
||||
request.url = Mock(path="/")
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "platform.com"
|
||||
mock_settings.main_domain = "platform.com"
|
||||
|
||||
context = StoreContextManager.detect_store_context(request)
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ class TestPlatformInjectionIntoStoreContext:
|
||||
mock_request.url = Mock(path="/store/login")
|
||||
|
||||
with patch("middleware.store_context.settings") as mock_settings:
|
||||
mock_settings.platform_domain = "omsflow.lu"
|
||||
mock_settings.main_domain = "omsflow.lu"
|
||||
|
||||
context = StoreContextManager.detect_store_context(mock_request)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user