fix has_replies function when get_replies returns None.

svn path=/plone.app.discussion/trunk/; revision=30256
This commit is contained in:
Timo Stollenwerk 2009-10-07 20:50:01 +00:00
parent f0cbc787ab
commit b09d42e505

View File

@ -243,12 +243,12 @@ class CommentsViewlet(ViewletBase, layout.FormWrapper):
"""Returns true if there are replies. """Returns true if there are replies.
""" """
try: try:
if self.get_replies(workflow_actions):
self.get_replies(workflow_actions).next() self.get_replies(workflow_actions).next()
return True return True
except StopIteration: except StopIteration:
return None return None
def get_replies(self, workflow_actions=False): def get_replies(self, workflow_actions=False):
"""Returns all replies to a content object. """Returns all replies to a content object.
@ -293,9 +293,6 @@ class CommentsViewlet(ViewletBase, layout.FormWrapper):
return replies_with_workflow_actions() return replies_with_workflow_actions()
else: else:
return published_replies() return published_replies()
else:
return None
def get_commenter_home_url(self, username): def get_commenter_home_url(self, username):
if username is None: if username is None: