fix has_replies function when get_replies returns None.
svn path=/plone.app.discussion/trunk/; revision=30256
This commit is contained in:
parent
f0cbc787ab
commit
b09d42e505
@ -243,12 +243,12 @@ class CommentsViewlet(ViewletBase, layout.FormWrapper):
|
|||||||
"""Returns true if there are replies.
|
"""Returns true if there are replies.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
self.get_replies(workflow_actions).next()
|
if self.get_replies(workflow_actions):
|
||||||
return True
|
self.get_replies(workflow_actions).next()
|
||||||
|
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:
|
||||||
|
Loading…
Reference in New Issue
Block a user