Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix saving language code in customerUpdate mutation (#19254)

Marcin Wcisło84b2d8d86b8b
diff --git a/saleor/graphql/account/mutations/staff/utils.py b/saleor/graphql/account/mutations/staff/utils.py
index f79890af6e..8ffb4302d4 100644
--- a/saleor/graphql/account/mutations/staff/utils.py
+++ b/saleor/graphql/account/mutations/staff/utils.py
@@ -6,6 +6,7 @@ CUSTOMER_UPDATE_FIELDS = {
"note",
"external_reference",
"is_confirmed",
+ "language_code",
"metadata",
"private_metadata",
}
diff --git a/saleor/graphql/account/tests/mutations/staff/test_customer_update.py b/saleor/graphql/account/tests/mutations/staff/test_customer_update.py
index 4de8c38b04..d692666e85 100644
--- a/saleor/graphql/account/tests/mutations/staff/test_customer_update.py
+++ b/saleor/graphql/account/tests/mutations/staff/test_customer_update.py
@@ -113,6 +113,8 @@ def test_customer_update(
},
}
+ assert customer_user.language_code == "en"
+
# when
response = staff_api_client.post_graphql(
query, variables, permissions=[permission_manage_users]
@@ -164,6 +166,8 @@ def test_customer_update(
assert customer_user.updated_at > updated_at
+ assert customer_user.language_code == "pl"
+
customer_user.refresh_from_db()
assert customer_user.search_vector
assert customer_user.search_vector