Ticket #4404: 4404.patch
File 4404.patch, 1.1 KB (added by , 17 years ago) |
---|
-
django/contrib/comments/feeds.py
23 23 self._site = Site.objects.get_current() 24 24 return "Latest comments on %s" % self._site.name 25 25 26 def get_query_set(self): 27 return self.comments_class.objects.filter(site__pk=settings.SITE_ID, is_public=True) 28 26 29 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] 28 31 29 32 class LatestCommentsFeed(LatestFreeCommentsFeed): 30 33 """Feed of latest free comments on the current site""" 31 34 32 35 comments_class = Comment 33 36 34 def items(self):35 qs = LatestFreeCommentsFeed.items(self)37 def get_query_set(self): 38 qs = super(LatestCommentsFeed, self).get_query_set() 36 39 qs = qs.filter(is_removed=False) 37 40 if settings.COMMENTS_BANNED_USERS_GROUP: 38 41 where = ['user_id NOT IN (SELECT user_id FROM auth_users_group WHERE group_id = %s)']