Skip to content

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

Remove unwanted event trigger from addres mutations (#11395)

Jakub3f476109c7d6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index fa2de87110..533efed931 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,7 @@ All notable, unreleased changes to this project will be documented in this file.
- Fix fetching the `checkout.availableCollectionPoints` - #11489 by @IKarbowiak
- Move checkout metadata to separate model - #11264 by @jakubkuc
- Add ability to set a custom Celery queue for async webhook - #11511 by @NyanKiyoshi
+- Remove `CUSTOMER_UPDATED` webhook trigger from address mutations - #11395 by @jakubkuc
# 3.9.0
diff --git a/saleor/graphql/account/mutations/base.py b/saleor/graphql/account/mutations/base.py
index 32c881a559..0701b7a864 100644
--- a/saleor/graphql/account/mutations/base.py
+++ b/saleor/graphql/account/mutations/base.py
@@ -334,7 +334,6 @@ class BaseAddressUpdate(ModelMutation, I18nMixin):
user.search_document = prepare_user_search_document_value(user)
user.save(update_fields=["search_document", "updated_at"])
manager = get_plugin_manager_promise(info.context).get()
- cls.call_event(manager.customer_updated, user)
address = manager.change_user_address(address, None, user)
cls.call_event(manager.address_updated, address)
@@ -397,7 +396,6 @@ class BaseAddressDelete(ModelDeleteMutation):
response.user = user
manager = get_plugin_manager_promise(info.context).get()
- cls.call_event(manager.customer_updated, user)
cls.call_event(manager.address_deleted, instance)
return response
diff --git a/saleor/graphql/account/tests/test_account.py b/saleor/graphql/account/tests/test_account.py
index 4fa9dda8fe..25e2a46e9d 100644
--- a/saleor/graphql/account/tests/test_account.py
+++ b/saleor/graphql/account/tests/test_account.py
@@ -4488,7 +4488,7 @@ def test_customer_address_update_trigger_webhook(
# then
assert content["data"]["accountAddressUpdate"]
- mocked_webhook_trigger.assert_called_with(
+ mocked_webhook_trigger.assert_called_once_with(
*generate_address_webhook_call_args(
address,
WebhookEventAsyncType.ADDRESS_UPDATED,
@@ -4614,7 +4614,7 @@ def test_address_delete_mutation_trigger_webhook(
# then
assert content["data"]["addressDelete"]
- mocked_webhook_trigger.assert_called_with(
+ mocked_webhook_trigger.assert_called_once_with(
*generate_address_webhook_call_args(
address,
WebhookEventAsyncType.ADDRESS_DELETED,