cb1bf28c16
Follow https://github.com/plone/jenkins.plone.org/blob/master/docs/source/run-qa-on-package.rst to clean up the code.
17 lines
463 B
Python
17 lines
463 B
Python
# -*- coding: utf-8 -*-
|
|
from Products.CMFCore.utils import getToolByName
|
|
|
|
|
|
def index_object(obj, event):
|
|
"""Index the object when it is added to the conversation.
|
|
"""
|
|
catalog = getToolByName(obj, 'portal_catalog')
|
|
return catalog.reindexObject(obj)
|
|
|
|
|
|
def unindex_object(obj, event):
|
|
"""Unindex the object when it is removed from the conversation.
|
|
"""
|
|
catalog = getToolByName(obj, 'portal_catalog')
|
|
return catalog.unindexObject(obj)
|