Skip to content

Commit

Permalink
only exclude if end date is within the period (in case we send these …
Browse files Browse the repository at this point in the history
…on a delay for some reason)
  • Loading branch information
raquelmsmith committed Dec 30, 2024
1 parent fab1885 commit 224fcb8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions posthog/tasks/periodic_digest.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,16 @@ 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, end_date__isnull=True).values(
"team_id", "name", "id", "start_date"
return (
Experiment.objects.filter(
start_date__gt=begin,
start_date__lte=end,
)
.exclude(
end_date__gt=begin,
end_date__lte=end,
)
.values("team_id", "name", "id", "start_date")
)


Expand Down

0 comments on commit 224fcb8

Please sign in to comment.