mirror of https://github.com/zulip/zulip.git
onboarding: Rename variable to cutoff_date.
This is just as clear in terms of intent, and it's robust to us tweaking the number of weeks.
This commit is contained in:
parent
0891f9f65a
commit
4533ff3671
|
@ -180,9 +180,9 @@ def add_new_user_history(user_profile: UserProfile, streams: Iterable[Stream]) -
|
|||
recipient_ids = [stream.recipient_id for stream in streams if not stream.invite_only]
|
||||
|
||||
# Start by finding recent messages matching those recipients.
|
||||
one_month_ago = timezone_now() - ONBOARDING_RECENT_TIMEDELTA
|
||||
cutoff_date = timezone_now() - ONBOARDING_RECENT_TIMEDELTA
|
||||
recent_message_ids = set(
|
||||
Message.objects.filter(recipient_id__in=recipient_ids, date_sent__gt=one_month_ago)
|
||||
Message.objects.filter(recipient_id__in=recipient_ids, date_sent__gt=cutoff_date)
|
||||
.order_by("-id")
|
||||
.values_list("id", flat=True)[0:MAX_NUM_ONBOARDING_MESSAGES]
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue