Skip to content

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

add proper event_type when locking webhooks (#14454)

Artur373efa067922
diff --git a/saleor/graphql/account/bulk_mutations/staff_bulk_delete.py b/saleor/graphql/account/bulk_mutations/staff_bulk_delete.py
index 4da0ad4167..24f4cc0f2b 100644
--- a/saleor/graphql/account/bulk_mutations/staff_bulk_delete.py
+++ b/saleor/graphql/account/bulk_mutations/staff_bulk_delete.py
@@ -67,6 +67,6 @@ class StaffBulkDelete(StaffDeleteMixin, UserBulkDelete):
instances = list(queryset)
queryset.delete()
manager = get_plugin_manager_promise(info.context).get()
- webhooks = get_webhooks_for_event(WebhookEventAsyncType.ATTRIBUTE_DELETED)
+ webhooks = get_webhooks_for_event(WebhookEventAsyncType.STAFF_DELETED)
for instance in instances:
cls.call_event(manager.staff_deleted, instance, webhooks=webhooks)
diff --git a/saleor/graphql/account/tests/bulk_mutations/test_staff_bulk_delete.py b/saleor/graphql/account/tests/bulk_mutations/test_staff_bulk_delete.py
index 1a407ff342..05e9be1142 100644
--- a/saleor/graphql/account/tests/bulk_mutations/test_staff_bulk_delete.py
+++ b/saleor/graphql/account/tests/bulk_mutations/test_staff_bulk_delete.py
@@ -48,7 +48,7 @@ def test_delete_staff_members(
assert User.objects.filter(id__in=[user.id for user in users]).count() == len(users)
-@patch("saleor.plugins.webhook.plugin.get_webhooks_for_event")
+@patch("saleor.graphql.account.bulk_mutations.staff_bulk_delete.get_webhooks_for_event")
@patch("saleor.plugins.webhook.plugin.trigger_webhooks_async")
def test_delete_staff_members_trigger_webhook(
mocked_webhook_trigger,
diff --git a/saleor/graphql/discount/mutations/promotion/promotion_bulk_delete.py b/saleor/graphql/discount/mutations/promotion/promotion_bulk_delete.py
index febf97b228..989ed50fd2 100644
--- a/saleor/graphql/discount/mutations/promotion/promotion_bulk_delete.py
+++ b/saleor/graphql/discount/mutations/promotion/promotion_bulk_delete.py
@@ -45,7 +45,7 @@ class PromotionBulkDelete(ModelBulkDeleteMutation):
queryset.delete()
manager = get_plugin_manager_promise(info.context).get()
- webhooks = get_webhooks_for_event(WebhookEventAsyncType.ATTRIBUTE_DELETED)
+ webhooks = get_webhooks_for_event(WebhookEventAsyncType.PROMOTION_DELETED)
for promotion in promotions:
cls.call_event(manager.promotion_deleted, promotion, webhooks=webhooks)