Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #4404 -- Fixed LatestCommentsFeed query problem. Thanks, Smiley…

…Chris.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5408 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8728e0f35398e05bba9956b5b85f7cc3fbf33143 1 parent 63a1304
@malcolmt malcolmt authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 django/contrib/comments/feeds.py
View
9 django/contrib/comments/feeds.py
@@ -23,16 +23,19 @@ def description(self):
self._site = Site.objects.get_current()
return "Latest comments on %s" % self._site.name
+ def get_query_set(self):
+ return self.comments_class.objects.filter(site__pk=settings.SITE_ID, is_public=True)
+
def items(self):
- return self.comments_class.objects.filter(site__pk=settings.SITE_ID, is_public=True)[:40]
+ return self.get_query_set()[:40]
class LatestCommentsFeed(LatestFreeCommentsFeed):
"""Feed of latest free comments on the current site"""
comments_class = Comment
- def items(self):
- qs = LatestFreeCommentsFeed.items(self)
+ def get_query_set(self):
+ qs = super(LatestCommentsFeed, self).get_query_set()
qs = qs.filter(is_removed=False)
if settings.COMMENTS_BANNED_USERS_GROUP:
where = ['user_id NOT IN (SELECT user_id FROM auth_users_group WHERE group_id = %s)']
Please sign in to comment.
Something went wrong with that request. Please try again.