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)