diff --git a/ee/api/chalicelib/core/roles.py b/ee/api/chalicelib/core/roles.py index 146fe2401..9b8a9b56e 100644 --- a/ee/api/chalicelib/core/roles.py +++ b/ee/api/chalicelib/core/roles.py @@ -11,7 +11,7 @@ from chalicelib.utils.TimeUTC import TimeUTC def __exists_by_name(tenant_id: int, name: str, exclude_id: Optional[int]) -> bool: with pg_client.PostgresClient() as cur: - query = cur.mogrify(f"""SELECT EXISTS(SELECT count(1) AS count + query = cur.mogrify(f"""SELECT EXISTS(SELECT 1 FROM public.roles WHERE tenant_id = %(tenant_id)s AND name ILIKE %(name)s diff --git a/ee/api/chalicelib/core/webhook.py b/ee/api/chalicelib/core/webhook.py index 1a69f8d3f..584db9839 100644 --- a/ee/api/chalicelib/core/webhook.py +++ b/ee/api/chalicelib/core/webhook.py @@ -115,7 +115,7 @@ def add(tenant_id, endpoint, auth_header=None, webhook_type='webhook', name="", def exists_by_name(tenant_id: int, name: str, exclude_id: Optional[int], webhook_type: str = schemas.WebhookType.webhook) -> bool: with pg_client.PostgresClient() as cur: - query = cur.mogrify(f"""SELECT EXISTS(SELECT count(1) AS count + query = cur.mogrify(f"""SELECT EXISTS(SELECT 1 FROM public.webhooks WHERE name ILIKE %(name)s AND deleted_at ISNULL