From 7476964ccad3716bffadada9f2d9b097283f8b4f Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 20 Jan 2022 16:33:24 -0800 Subject: [PATCH] Show only recent results in rss feed view --- bookwyrm/views/rss_feed.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bookwyrm/views/rss_feed.py b/bookwyrm/views/rss_feed.py index b924095c..1e9d5746 100644 --- a/bookwyrm/views/rss_feed.py +++ b/bookwyrm/views/rss_feed.py @@ -4,7 +4,6 @@ from django.contrib.syndication.views import Feed from django.template.loader import get_template from django.utils.translation import gettext_lazy as _ -from bookwyrm import models from .helpers import get_user_from_username # pylint: disable=no-self-use, unused-argument @@ -36,10 +35,9 @@ class RssFeed(Feed): def items(self, obj): """the user's activity feed""" - return models.Status.privacy_filter( - obj, - privacy_levels=["public", "unlisted"], - ).filter(user=obj) + return obj.status_set.select_subclasses().filter( + privacy__in=["public", "unlisted"], + )[:10] def item_link(self, item): """link to the status"""