Commit e0725ff1 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Raise error in case object is not found. Also, no need to resolve path again

parent 8d9048b5
......@@ -624,15 +624,7 @@ class BusinessItem(XMLObject):
p = context.getPortalObject()
path = self.getProperty('item_path')
try:
# XXX: After we apply _resolve path list while storing Data for the
# Business Manager, this should be of no use as there will be no path
# where we are going to achieve something different for relative_path
# from the result of _resolvePath on a given path.
# TODO: Remove this after checking successfull implementation of
# _resolve path in Business Manager in storeTemplateData
for relative_url in self._resolvePath(p, [], path.split('/')):
obj = p.unrestrictedTraverse(relative_url)
obj = p.unrestrictedTraverse(path)
obj = obj._getCopy(context)
# We should remove the extra properties of object so that there
......@@ -653,9 +645,6 @@ class BusinessItem(XMLObject):
obj.isIndexable = ConstantGetter('isIndexable', value=False)
new_id = self.generateNewId()
self._setObject(new_id, obj, suppress_events=True)
except AttributeError:
# In case the object doesn't exist, just pass without raising error
pass
def _resolvePath(self, folder, relative_url_list, id_list):
"""
......
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