Issue-3187: fix failing tests

This commit is contained in:
Rohan Sureshkumar 2024-01-24 19:18:46 +05:30
parent 8e2649ba3b
commit c4596544a3

View file

@ -52,9 +52,18 @@ class Feed(View):
paginated = Paginator(filtered_activities, PAGE_LENGTH)
suggestions = suggested_users.get_suggestions(request.user)
cutoff = date(get_annual_summary_year(), 12, 31)
readthroughs = models.ReadThrough.objects.filter(
user=request.user, finish_date__lte=cutoff
cutoff = (
date(get_annual_summary_year(), 12, 31)
if get_annual_summary_year()
else None
)
readthroughs = (
models.ReadThrough.objects.filter(
user=request.user, finish_date__lte=cutoff
)
if get_annual_summary_year()
else []
)
data = {