From f8f833bb82d9caf1ceed7d52ea1b78c7541ab13c Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 19 Dec 2024 10:05:18 +0100 Subject: [PATCH 1/6] Fixes --- posthog/api/hog_function.py | 3 ++- posthog/models/remote_config.py | 2 +- posthog/models/test/test_remote_config.py | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/posthog/api/hog_function.py b/posthog/api/hog_function.py index 4549f4f3a8bb5..8e091ea1be4b5 100644 --- a/posthog/api/hog_function.py +++ b/posthog/api/hog_function.py @@ -292,6 +292,7 @@ def get_serializer_class(self) -> type[BaseSerializer]: return HogFunctionMinimalSerializer if self.action == "list" else HogFunctionSerializer def safely_get_queryset(self, queryset: QuerySet) -> QuerySet: + queryset = queryset.filter(deleted=False) if self.action == "list": if "type" in self.request.GET: types = [self.request.GET.get("type", "destination")] @@ -299,7 +300,7 @@ def safely_get_queryset(self, queryset: QuerySet) -> QuerySet: types = self.request.GET.get("types", "destination").split(",") else: types = ["destination"] - queryset = queryset.filter(deleted=False, type__in=types) + queryset = queryset.filter(type__in=types) if self.request.GET.get("filters"): try: diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.py index 3380089ef61ed..aa4ed7c59d379 100644 --- a/posthog/models/remote_config.py +++ b/posthog/models/remote_config.py @@ -266,7 +266,7 @@ def _build_site_apps_js(self): ) site_functions = ( HogFunction.objects.select_related("team") - .filter(team=self.team, enabled=True, type__in=("site_destination", "site_app")) + .filter(team=self.team, enabled=True, deleted=False, type__in=("site_destination", "site_app")) .all() ) diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.py index d06ec45dcdc69..52bfc71821a79 100644 --- a/posthog/models/test/test_remote_config.py +++ b/posthog/models/test/test_remote_config.py @@ -813,3 +813,25 @@ def test_renders_js_including_site_functions(self): })();\ """ # noqa: W291, W293 ) + + def test_removes_deleted_site_functions(self): + site_destination = HogFunction.objects.create( + name="Site destination", + type=HogFunctionType.SITE_DESTINATION, + team=self.team, + enabled=True, + filters={ + "events": [{"id": "$pageview", "name": "$pageview", "type": "events", "order": 0}], + "filter_test_accounts": True, + }, + ) + + js = self.remote_config.get_config_js_via_token(self.team.api_token) + + assert str(site_destination.id) in js + + site_destination.deleted = True + site_destination.save() + + js = self.remote_config.get_config_js_via_token(self.team.api_token) + assert str(site_destination.id) not in js From ffef9c2a044bc25f6e7a895ea3479d420d1bb3b8 Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 19 Dec 2024 10:14:18 +0100 Subject: [PATCH 2/6] Fix undeleting --- posthog/api/hog_function.py | 5 ++++- posthog/api/test/test_hog_function.py | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/posthog/api/hog_function.py b/posthog/api/hog_function.py index 8e091ea1be4b5..3f50d710acc96 100644 --- a/posthog/api/hog_function.py +++ b/posthog/api/hog_function.py @@ -292,7 +292,10 @@ def get_serializer_class(self) -> type[BaseSerializer]: return HogFunctionMinimalSerializer if self.action == "list" else HogFunctionSerializer def safely_get_queryset(self, queryset: QuerySet) -> QuerySet: - queryset = queryset.filter(deleted=False) + if not (self.action == "partial_update" and self.request.data.get("deleted") is False): + # We only want to include deleted functions if we are un-deleting them + queryset = queryset.filter(deleted=False) + if self.action == "list": if "type" in self.request.GET: types = [self.request.GET.get("type", "destination")] diff --git a/posthog/api/test/test_hog_function.py b/posthog/api/test/test_hog_function.py index b988b53fdbbfb..414f5f19aa51f 100644 --- a/posthog/api/test/test_hog_function.py +++ b/posthog/api/test/test_hog_function.py @@ -367,6 +367,29 @@ def test_deletes_via_update(self, *args): ] assert filtered_actual_activities == expected_activities + def test_can_undelete_hog_function(self, *args): + response = self.client.post( + f"/api/projects/{self.team.id}/hog_functions/", + data={**EXAMPLE_FULL}, + ) + id = response.json()["id"] + + response = self.client.patch( + f"/api/projects/{self.team.id}/hog_functions/{id}/", + data={"deleted": True}, + ) + assert response.status_code == status.HTTP_200_OK, response.json() + assert ( + self.client.get(f"/api/projects/{self.team.id}/hog_functions/{id}").status_code == status.HTTP_404_NOT_FOUND + ) + + response = self.client.patch( + f"/api/projects/{self.team.id}/hog_functions/{id}/", + data={"deleted": False}, + ) + assert response.status_code == status.HTTP_200_OK, response.json() + assert self.client.get(f"/api/projects/{self.team.id}/hog_functions/{id}").status_code == status.HTTP_200_OK + def test_inputs_required(self, *args): payload = { "name": "Fetch URL", From 89e048b0b7b523e37abce8ce05db4fdfe52636a9 Mon Sep 17 00:00:00 2001 From: Ben White Date: Thu, 19 Dec 2024 10:17:16 +0100 Subject: [PATCH 3/6] Fix target --- posthog/cdp/templates/zapier/template_zapier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/posthog/cdp/templates/zapier/template_zapier.py b/posthog/cdp/templates/zapier/template_zapier.py index 6f47b444ea2ac..bdd41ffa2a904 100644 --- a/posthog/cdp/templates/zapier/template_zapier.py +++ b/posthog/cdp/templates/zapier/template_zapier.py @@ -37,7 +37,7 @@ "hook": { "id": "{source.url}", "event": "{event}", - "target": "https://hooks.zapier.com/{inputs.hook}", + "target": "https://hooks.zapier.com", }, "data": { "eventUuid": "{event.uuid}", From db485b4b94f7b9cc18fdb47b8e451bf4bd7154b8 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:31:19 +0000 Subject: [PATCH 4/6] Update query snapshots --- posthog/api/test/__snapshots__/test_survey.ambr | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/posthog/api/test/__snapshots__/test_survey.ambr b/posthog/api/test/__snapshots__/test_survey.ambr index f4e08a30e1622..aa3b526b3c9ee 100644 --- a/posthog/api/test/__snapshots__/test_survey.ambr +++ b/posthog/api/test/__snapshots__/test_survey.ambr @@ -465,7 +465,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -873,7 +874,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1339,7 +1341,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1733,7 +1736,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -2156,7 +2160,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) From b70b3fbf2e931f3b0b37760e62040232a4f6019e Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:32:19 +0000 Subject: [PATCH 5/6] Update query snapshots --- .../api/test/__snapshots__/test_decide.ambr | 54 ++++++++++++------- .../test_early_access_feature.ambr | 12 +++-- .../test_organization_feature_flag.ambr | 6 ++- 3 files changed, 48 insertions(+), 24 deletions(-) diff --git a/posthog/api/test/__snapshots__/test_decide.ambr b/posthog/api/test/__snapshots__/test_decide.ambr index 049ef77b360b5..277d209486401 100644 --- a/posthog/api/test/__snapshots__/test_decide.ambr +++ b/posthog/api/test/__snapshots__/test_decide.ambr @@ -704,7 +704,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1672,7 +1673,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -2080,7 +2082,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -2708,7 +2711,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -3104,7 +3108,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -3402,7 +3407,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -3766,7 +3772,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -4903,7 +4910,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -5401,7 +5409,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -5759,7 +5768,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -6518,7 +6528,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -6815,7 +6826,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -7211,7 +7223,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -7557,7 +7570,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -8185,7 +8199,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -8482,7 +8497,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -8874,7 +8890,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -9212,7 +9229,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) diff --git a/posthog/api/test/__snapshots__/test_early_access_feature.ambr b/posthog/api/test/__snapshots__/test_early_access_feature.ambr index c7820616d0cfd..874a79147df2c 100644 --- a/posthog/api/test/__snapshots__/test_early_access_feature.ambr +++ b/posthog/api/test/__snapshots__/test_early_access_feature.ambr @@ -434,7 +434,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1004,7 +1005,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1627,7 +1629,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -2132,7 +2135,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) diff --git a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr index 5b8721a2cd48f..55bc1f7121eb1 100644 --- a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr +++ b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr @@ -422,7 +422,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1726,7 +1727,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) From 06c5269e04d45f1f791243508f6baca00f563f41 Mon Sep 17 00:00:00 2001 From: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 09:34:11 +0000 Subject: [PATCH 6/6] Update query snapshots --- .../test_process_scheduled_changes.ambr | 9 ++++++--- posthog/test/__snapshots__/test_feature_flag.ambr | 15 ++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr index 563d97146fefe..059600098cd50 100644 --- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr +++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr @@ -483,7 +483,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1113,7 +1114,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1590,7 +1592,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) diff --git a/posthog/test/__snapshots__/test_feature_flag.ambr b/posthog/test/__snapshots__/test_feature_flag.ambr index 26e3b9acfa02a..32352422e1f1a 100644 --- a/posthog/test/__snapshots__/test_feature_flag.ambr +++ b/posthog/test/__snapshots__/test_feature_flag.ambr @@ -558,7 +558,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -992,7 +993,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1351,7 +1353,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -1839,7 +1842,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app')) @@ -2593,7 +2597,8 @@ "posthog_team"."external_data_workspace_last_synced_at" FROM "posthog_hogfunction" INNER JOIN "posthog_team" ON ("posthog_hogfunction"."team_id" = "posthog_team"."id") - WHERE ("posthog_hogfunction"."enabled" + WHERE (NOT "posthog_hogfunction"."deleted" + AND "posthog_hogfunction"."enabled" AND "posthog_hogfunction"."team_id" = 99999 AND "posthog_hogfunction"."type" IN ('site_destination', 'site_app'))