From b09d42e5053290eba1dd04f3e4ab5f84af6c2091 Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Wed, 7 Oct 2009 20:50:01 +0000 Subject: [PATCH] fix has_replies function when get_replies returns None. svn path=/plone.app.discussion/trunk/; revision=30256 --- plone/app/discussion/browser/comments.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plone/app/discussion/browser/comments.py b/plone/app/discussion/browser/comments.py index 1ee2ea0..bea53b5 100644 --- a/plone/app/discussion/browser/comments.py +++ b/plone/app/discussion/browser/comments.py @@ -243,12 +243,12 @@ class CommentsViewlet(ViewletBase, layout.FormWrapper): """Returns true if there are replies. """ try: - self.get_replies(workflow_actions).next() - return True + if self.get_replies(workflow_actions): + self.get_replies(workflow_actions).next() + return True except StopIteration: return None - def get_replies(self, workflow_actions=False): """Returns all replies to a content object. @@ -293,9 +293,6 @@ class CommentsViewlet(ViewletBase, layout.FormWrapper): return replies_with_workflow_actions() else: return published_replies() - else: - return None - def get_commenter_home_url(self, username): if username is None: