From d5b5b1c2cd269f1cfa27fb47df8fd44d18a6c4ef Mon Sep 17 00:00:00 2001 From: Gil Forcada Date: Mon, 16 Feb 2015 10:07:02 +0100 Subject: [PATCH] Fix total_comments indexer "@property removes Acquisition wrappers from 'self'. I don't remember why exactly (some implementation detail of Acquisition), but it's a fact of life." Quote from @davisagli on https://github.com/plone/plone.app.discussion/pull/58 In short: removing the @property from total_comments fix the problem. --- plone/app/discussion/catalog.py | 2 +- plone/app/discussion/conversation.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/plone/app/discussion/catalog.py b/plone/app/discussion/catalog.py index 12382df..5034928 100644 --- a/plone/app/discussion/catalog.py +++ b/plone/app/discussion/catalog.py @@ -33,7 +33,7 @@ def total_comments(object): if object.meta_type != 'Discussion Item': try: conversation = IConversation(object) - return conversation.total_comments + return conversation.total_comments() except TypeError: # pragma: no cover # The item is contentish but nobody # implemented an adapter for it diff --git a/plone/app/discussion/conversation.py b/plone/app/discussion/conversation.py index e73546a..01d3182 100644 --- a/plone/app/discussion/conversation.py +++ b/plone/app/discussion/conversation.py @@ -77,7 +77,6 @@ class Conversation(Traversable, Persistent, Explicit): parent = aq_inner(self.__parent__) return parent.restrictedTraverse('@@conversation_view').enabled() - @property def total_comments(self): public_comments = [ x for x in self.values()