Ticket #4404: 4404.patch

File 4404.patch, 1.1 KB (added by Chris Beaven, 17 years ago)
  • django/contrib/comments/feeds.py

     
    2323            self._site = Site.objects.get_current()
    2424        return "Latest comments on %s" % self._site.name
    2525
     26    def get_query_set(self):
     27        return self.comments_class.objects.filter(site__pk=settings.SITE_ID, is_public=True)
     28
    2629    def items(self):
    27         return self.comments_class.objects.filter(site__pk=settings.SITE_ID, is_public=True)[:40]
     30        return self.get_query_set()[:40]
    2831
    2932class LatestCommentsFeed(LatestFreeCommentsFeed):
    3033    """Feed of latest free comments on the current site"""
    3134
    3235    comments_class = Comment
    3336
    34     def items(self):
    35         qs = LatestFreeCommentsFeed.items(self)
     37    def get_query_set(self):
     38        qs = super(LatestCommentsFeed, self).get_query_set()
    3639        qs = qs.filter(is_removed=False)
    3740        if settings.COMMENTS_BANNED_USERS_GROUP:
    3841            where = ['user_id NOT IN (SELECT user_id FROM auth_users_group WHERE group_id = %s)']
Back to Top