Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix setup_context_use function to handle ReadOnlyMiddleware (#11029)
SzymJf8d0f2be2a04
diff --git a/saleor/graphql/core/context.py b/saleor/graphql/core/context.pyindex 14ad9a031a..2638c2dca1 100644--- a/saleor/graphql/core/context.py+++ b/saleor/graphql/core/context.py@@ -55,6 +55,8 @@ def get_database_connection_name(context: SaleorContext) -> str:def setup_context_user(context: SaleorContext) -> None:- if getattr(context.user, "_wrapped", None) is empty:+ if hasattr(context.user, "_wrapped") and (+ context.user._wrapped is empty or context.user._wrapped is None # type: ignore+ ):context.user._setup() # type: ignorecontext.user = context.user._wrapped # type: ignore