posthog icon indicating copy to clipboard operation
posthog copied to clipboard

fix(api): Do not return deleted web experiments for `/api/projects/:project_id/web_experiments/`

Open lshaowei18 opened this issue 6 months ago • 0 comments

[!IMPORTANT] 👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Problem

Closes #33670

Changes

I believe the router for api is using WebExperimentViewSet, and as referenced from the other view sets it seems like most are using safely_get_queryset if they want to filter/exclude.

Did you write or update any docs for this change?

  • [x] No docs needed for this change

How did you test this code?

Locally:

  1. Create no code experiment
  2. Delete it
  3. Fire off get api request should not return me the experiment.

P.S: Is there any unit test that I need to write for this?

lshaowei18 avatar Jun 14 '25 03:06 lshaowei18