Skip to content

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

Remvoe service account search from webhook

Maciej Korycinski512f60e1cf99
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 665ce145cc..fe6499fcce 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -4331,7 +4331,6 @@ enum WebhookEventTypeEnum {
input WebhookFilterInput {
search: String
isActive: Boolean
- serviceAccount: String
}
type WebhookUpdate {
diff --git a/saleor/graphql/webhook/filters.py b/saleor/graphql/webhook/filters.py
index f8f3478629..4314eb946e 100644
--- a/saleor/graphql/webhook/filters.py
+++ b/saleor/graphql/webhook/filters.py
@@ -11,15 +11,7 @@ def filter_webhook_search(qs, _, value):
return qs
-def filter_service_account(qs, _, value):
- qs = qs.prefetch_related("service_account")
- service_account_fields = ["service_account__name"]
- qs = filter_by_query_param(qs, value, service_account_fields)
- return qs
-
-
class WebhookFilter(django_filters.FilterSet):
- service_account = django_filters.CharFilter(method=filter_service_account)
search = django_filters.CharFilter(method=filter_webhook_search)
is_active = django_filters.BooleanFilter()
diff --git a/tests/api/test_webhook.py b/tests/api/test_webhook.py
index f10a777743..341001e7ba 100644
--- a/tests/api/test_webhook.py
+++ b/tests/api/test_webhook.py
@@ -386,7 +386,6 @@ def test_query_webhooks_by_service_account(service_account_api_client, webhook):
[
{"isActive": False},
{"search": "Sample"},
- {"serviceAccount": "Second sample service"},
{"isActive": False, "search": "Sample"},
],
)