Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mikemintz/deme
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhuang committed Jul 2, 2013
2 parents 42c607f + 3b9f431 commit 48fa195
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deme_django/modules/discussionboard/views.py
Expand Up @@ -12,11 +12,11 @@ class DiscussionViewer(ItemViewer):
def item_show_html(self):
self.context['action_title'] = ''
template = loader.get_template('discussionboard/show.html')
top_level_comments = list(TextComment.objects.filter(item=self.item))
top_level_comments = list(TextComment.objects.filter(item=self.item, active=True))
last_posts = {}
num_replies = {}
for top_level_comment in top_level_comments:
all_replies = TextComment.objects.filter(pk__in=RecursiveComment.objects.filter(parent=top_level_comment).values('child').query)
all_replies = TextComment.objects.filter(pk__in=RecursiveComment.objects.filter(parent=top_level_comment).values('child').query, active=True)
for reply in all_replies.order_by('-created_at')[:1]:
last_posts[top_level_comment] = reply
num_replies[top_level_comment] = all_replies.count()
Expand Down

0 comments on commit 48fa195

Please sign in to comment.