This commit is contained in:
tisto 2013-12-15 12:02:32 +01:00
parent b5f4df5f17
commit f0a9d9ad6b
5 changed files with 3 additions and 8 deletions

View File

@ -1,7 +1,5 @@
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
from zope.component import queryUtility
from Acquisition import aq_inner, aq_parent from Acquisition import aq_inner, aq_parent
from zope.annotation.interfaces import IAnnotations from zope.annotation.interfaces import IAnnotations

View File

@ -1,14 +1,15 @@
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName
def index_object(obj, event): def index_object(obj, event):
"""Index the object when it is added to the conversation. """Index the object when it is added to the conversation.
""" """
catalog = getToolByName(obj, 'portal_catalog') catalog = getToolByName(obj, 'portal_catalog')
return catalog.reindexObject(obj) return catalog.reindexObject(obj)
def unindex_object(obj, event): def unindex_object(obj, event):
"""Unindex the object when it is removed from the conversation. """Unindex the object when it is removed from the conversation.
""" """
catalog = getToolByName(obj, 'portal_catalog') catalog = getToolByName(obj, 'portal_catalog')
return catalog.unindexObject(obj) return catalog.unindexObject(obj)

View File

@ -19,8 +19,6 @@ from plone.app.discussion.testing import (
from plone.app.discussion.interfaces import IConversation from plone.app.discussion.interfaces import IConversation
from plone.app.discussion.testing import COLLECTION_TYPE
class CatalogSetupTest(unittest.TestCase): class CatalogSetupTest(unittest.TestCase):

View File

@ -308,7 +308,7 @@ class ConversationTest(unittest.TestCase):
# Create a folder # Create a folder
self.typetool.constructContent('Folder', self.portal, 'f1') self.typetool.constructContent('Folder', self.portal, 'f1')
f1 = self.portal.f1
# Usually we don't create a conversation on a folder # Usually we don't create a conversation on a folder
conversation = self.portal.f1.restrictedTraverse('@@conversation_view') conversation = self.portal.f1.restrictedTraverse('@@conversation_view')

View File

@ -1,8 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest import unittest
from DateTime import DateTime
from zope.component import createObject from zope.component import createObject
from Products.CMFCore.utils import getToolByName from Products.CMFCore.utils import getToolByName