Commit be552b63 authored by Tatuya Kamada's avatar Tatuya Kamada

Business Template: Remove new_obj parameter from unindexBrokenObject().

Fewer parameters are better if it is not mandatory (Loose Coupling principle).
parent b3de8c77
......@@ -932,7 +932,7 @@ class ObjectTemplateItem(BaseTemplateItem):
keys.sort()
return keys
def unindexBrokenObject(self, new_obj, item_path):
def unindexBrokenObject(self, item_path):
"""
Unindex broken objects.
......@@ -945,7 +945,6 @@ class ObjectTemplateItem(BaseTemplateItem):
in the file system, thus several objects tend to be broken.
Keyword arguments:
new_obj -- the object in the BusinessTemplate
item_path -- the path specified by the ObjectTemplateItem
"""
def flushActivity(obj, invoke=0, **kw):
......@@ -986,8 +985,6 @@ class ObjectTemplateItem(BaseTemplateItem):
serialization_tag=root_document_path
).unindexObject(uid=uid)
# check isIndexable with new one, because the old one is broken
if new_obj.isIndexable():
portal = self.getPortalObject()
try:
catalog = portal.portal_catalog
......@@ -1100,7 +1097,9 @@ class ObjectTemplateItem(BaseTemplateItem):
# unindex here when it is a broken object
if isinstance(old_obj, Broken):
new_obj = self._objects[path]
self.unindexBrokenObject(new_obj, path)
# check isIndexable with new one, because the old one is broken
if new_obj.isIndexable():
self.unindexBrokenObject(path)
# install object
obj = self._objects[path]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment