Skip to content

Commit

Permalink
Excluded unpublished comments from the displayed count for sites with…
Browse files Browse the repository at this point in the history
… plone.app.discussion.

git-svn-id: http://svn.plone.org/svn/collective/Scrawl/trunk@248779 db7f04ef-aaf3-0310-a811-c281ed44c4ad
  • Loading branch information
Matt Yoder committed Mar 8, 2012
1 parent 312d661 commit 1bccdbc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.txt
Expand Up @@ -4,6 +4,10 @@ Changelog
Scrawl 2.0 - unreleased
-----------------------

- Excluded unpublished comments from the displayed count for sites with
plone.app.discussion.
[yomatters]

- Allowed filtering of blog view by author.
[yomatters]

Expand Down
5 changes: 4 additions & 1 deletion Products/Scrawl/browser/blog.py
Expand Up @@ -25,7 +25,10 @@ def comment_count(self, obj):
if HAS_PAD:
if IDiscussionLayer.providedBy(self.request):
conversation = IConversation(obj)
return conversation.enabled() and len(conversation)
if conversation.enabled():
workflow = getToolByName(self.context, 'portal_workflow')
return len([c for c in conversation.values() \
if workflow.getInfoFor(c, 'review_state') == 'published'])
if self.portal_discussion.isDiscussionAllowedFor(obj):
discussion = self.portal_discussion.getDiscussionFor(obj)
return discussion.replyCount(obj)
Expand Down

0 comments on commit 1bccdbc

Please sign in to comment.