Count acquisition wrapped comments

If the View permission is not set directly on the workflow,
but instead is left to be acquired,
total_comments will always return 0.
This commit is contained in:
Gil Forcada 2014-12-05 02:09:46 +01:00
parent b4c1d9e42d
commit 535af3aace

View File

@ -80,7 +80,7 @@ class Conversation(Traversable, Persistent, Explicit):
@property
def total_comments(self):
public_comments = [
x for x in self._comments.values()
x for x in self.values()
if user_nobody.has_permission('View', x)
]
return len(public_comments)