Skip to content

Commit

Permalink
Fixed #4404 -- Fixed LatestCommentsFeed query problem. Thanks, Smiley…
Browse files Browse the repository at this point in the history
…Chris.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5408 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Jun 1, 2007
1 parent 63a1304 commit 8728e0f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions django/contrib/comments/feeds.py
Expand Up @@ -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)']
Expand Down

0 comments on commit 8728e0f

Please sign in to comment.