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): ...@@ -932,7 +932,7 @@ class ObjectTemplateItem(BaseTemplateItem):
keys.sort() keys.sort()
return keys return keys
def unindexBrokenObject(self, new_obj, item_path): def unindexBrokenObject(self, item_path):
""" """
Unindex broken objects. Unindex broken objects.
...@@ -945,7 +945,6 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -945,7 +945,6 @@ class ObjectTemplateItem(BaseTemplateItem):
in the file system, thus several objects tend to be broken. in the file system, thus several objects tend to be broken.
Keyword arguments: Keyword arguments:
new_obj -- the object in the BusinessTemplate
item_path -- the path specified by the ObjectTemplateItem item_path -- the path specified by the ObjectTemplateItem
""" """
def flushActivity(obj, invoke=0, **kw): def flushActivity(obj, invoke=0, **kw):
...@@ -986,8 +985,6 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -986,8 +985,6 @@ class ObjectTemplateItem(BaseTemplateItem):
serialization_tag=root_document_path serialization_tag=root_document_path
).unindexObject(uid=uid) ).unindexObject(uid=uid)
# check isIndexable with new one, because the old one is broken
if new_obj.isIndexable():
portal = self.getPortalObject() portal = self.getPortalObject()
try: try:
catalog = portal.portal_catalog catalog = portal.portal_catalog
...@@ -1100,7 +1097,9 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -1100,7 +1097,9 @@ class ObjectTemplateItem(BaseTemplateItem):
# unindex here when it is a broken object # unindex here when it is a broken object
if isinstance(old_obj, Broken): if isinstance(old_obj, Broken):
new_obj = self._objects[path] 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 # install object
obj = self._objects[path] 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