From c10bdfdf421a44c27f1525a65cf4ddd41ea4fd4e Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Tue, 18 Nov 2025 23:41:51 +0100 Subject: [PATCH] fixing vendor context detection bug --- middleware/context_middleware.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/middleware/context_middleware.py b/middleware/context_middleware.py index 60a28b5c..53b6e075 100644 --- a/middleware/context_middleware.py +++ b/middleware/context_middleware.py @@ -88,8 +88,11 @@ class ContextManager: return RequestContext.ADMIN # 3. Vendor Dashboard context (vendor management area) - if ContextManager._is_vendor_dashboard_context(path): - logger.debug("[CONTEXT] Detected as VENDOR_DASHBOARD", extra={"path": path}) + # Check both clean_path and original path for vendor dashboard + original_path = request.url.path + if ContextManager._is_vendor_dashboard_context(path) or \ + ContextManager._is_vendor_dashboard_context(original_path): + logger.debug("[CONTEXT] Detected as VENDOR_DASHBOARD", extra={"path": path, "original_path": original_path}) return RequestContext.VENDOR_DASHBOARD # 4. Shop context (vendor storefront)