From 3d99908d27b67ac3005049a89316114f78105d5f Mon Sep 17 00:00:00 2001 From: Giebisch Date: Mon, 23 Jan 2023 15:17:20 +0100 Subject: [PATCH] Fixed Object Selection for RSS Feeds --- bookwyrm/views/rss_feed.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bookwyrm/views/rss_feed.py b/bookwyrm/views/rss_feed.py index 77e1e90ed..82a7b3dce 100644 --- a/bookwyrm/views/rss_feed.py +++ b/bookwyrm/views/rss_feed.py @@ -3,6 +3,7 @@ from django.contrib.syndication.views import Feed from django.template.loader import get_template from django.utils.translation import gettext_lazy as _ +from ..models import Review, Quotation, Comment from .helpers import get_user_from_username @@ -72,7 +73,8 @@ class RssReviewsOnlyFeed(Feed): def items(self, obj): """the user's activity feed""" - return obj.status_set.select_subclasses("review").filter( + return Review.objects.filter( + user=obj, privacy__in=["public", "unlisted"], )[:10] @@ -109,7 +111,8 @@ class RssQuotesOnlyFeed(Feed): def items(self, obj): """the user's activity feed""" - return obj.status_set.select_subclasses("quotation").filter( + return Quotation.objects.filter( + user=obj, privacy__in=["public", "unlisted"], )[:10] @@ -146,7 +149,8 @@ class RssCommentsOnlyFeed(Feed): def items(self, obj): """the user's activity feed""" - return obj.status_set.select_subclasses("comment").filter( + return Comment.objects.filter( + user=obj, privacy__in=["public", "unlisted"], )[:10]