Skip to content

Commit

Permalink
fix completed experiments also showing up in launched list
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelmsmith committed Dec 30, 2024
1 parent 9002bfe commit fab1885
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion posthog/tasks/periodic_digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_teams_with_new_playlists(end: datetime, begin: datetime) -> QuerySet:


def get_teams_with_new_experiments_launched(end: datetime, begin: datetime) -> QuerySet:
return Experiment.objects.filter(start_date__gt=begin, start_date__lte=end).values(
return Experiment.objects.filter(start_date__gt=begin, start_date__lte=end, end_date__isnull=True).values(
"team_id", "name", "id", "start_date"
)

Expand Down
4 changes: 2 additions & 2 deletions posthog/tasks/test/test_periodic_digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def test_periodic_digest_report(self, mock_capture: MagicMock) -> None:
completed_experiment = Experiment.objects.create(
team=self.team,
name="Completed Experiment",
start_date=now() + timedelta(days=1),
end_date=now() + timedelta(days=6),
start_date=now() + timedelta(days=6),
end_date=now() + timedelta(days=7),
feature_flag=flag_for_completed_experiment,
)

Expand Down

0 comments on commit fab1885

Please sign in to comment.