From c4596544a341a5030fe02fe7b1df704f343a35ee Mon Sep 17 00:00:00 2001 From: Rohan Sureshkumar Date: Wed, 24 Jan 2024 19:18:46 +0530 Subject: [PATCH] Issue-3187: fix failing tests --- bookwyrm/views/feed.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bookwyrm/views/feed.py b/bookwyrm/views/feed.py index 79e2f24d2..6e8f820e4 100644 --- a/bookwyrm/views/feed.py +++ b/bookwyrm/views/feed.py @@ -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 = {