Skip to content

Commit

Permalink
- Deprecated/changed unused method PortalCatalogProcessor.get_dispatc…
Browse files Browse the repository at this point in the history
…her (fixes #57)
  • Loading branch information
dataflake committed Feb 9, 2019
1 parent 0eec1be commit 50bc72e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ Products.CMFCore Changelog
2.4.0b7 (unreleased)
--------------------

- Deprecated unused method ``PortalCatalogProcessor.get_dispatcher``
(`#57 <https://github.com/zopefoundation/Products.CMFCore/issues/57>`_)

- Backport plone/collective.indexing#16 to use the catalog queue
also when reindexing the object security
(`#58 <https://github.com/zopefoundation/Products.CMFCore/issues/58>_`)
(`#58 <https://github.com/zopefoundation/Products.CMFCore/issues/58>`_)

- Code cleanup: avoid to call the ``keys`` method on dictionary
when not needed
Expand Down
5 changes: 4 additions & 1 deletion Products/CMFCore/indexing.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
from warnings import warn

from Acquisition import aq_base, aq_inner, aq_parent
from logging import getLogger
from Products.CMFCore.interfaces import IIndexQueue
Expand Down Expand Up @@ -63,13 +65,14 @@ def abort(self):
@staticmethod
def get_dispatcher(obj, name):
""" return named indexing method according on the used mixin class """
warn('get_dispatcher is deprecated and will be removed in version 2.5')
catalog = getToolByName(obj, 'portal_catalog', None)
if catalog is None:
return
attr = getattr(catalog, '_{0}'.format(name), None)
if attr is None:
return
return attr.im_func
return attr.__func__


def getQueue():
Expand Down

0 comments on commit 50bc72e

Please sign in to comment.