Commit 6c01f222 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Remove old object only if sign is -1

parent ded3605c
...@@ -716,10 +716,6 @@ class BusinessItem(Implicit, Persistent): ...@@ -716,10 +716,6 @@ class BusinessItem(Implicit, Persistent):
container_url = '/'.join(container_path) container_url = '/'.join(container_path)
old_obj = container._getOb(object_id, None) old_obj = container._getOb(object_id, None)
# delete the old object before installing a new object # delete the old object before installing a new object
if old_obj:
# XXX: In case there is an old object which has been modified from the
# older installation, then show the conflict status.
container._delObject(object_id)
# If sign is +1, set the new object on the container # If sign is +1, set the new object on the container
if self._sign == 1: if self._sign == 1:
# install object # install object
...@@ -732,6 +728,12 @@ class BusinessItem(Implicit, Persistent): ...@@ -732,6 +728,12 @@ class BusinessItem(Implicit, Persistent):
del obj.isIndexable del obj.isIndexable
if getattr(aq_base(obj), 'reindexObject', None) is not None: if getattr(aq_base(obj), 'reindexObject', None) is not None:
obj.reindexObject() obj.reindexObject()
else:
# Only in case if sign is -1
if old_obj:
# XXX: In case there is an old object which has been modified from the
# older installation, then show the conflict status.
container._delObject(object_id)
def unrestrictedResolveValue(self, context=None, path='', default=_MARKER, def unrestrictedResolveValue(self, context=None, path='', default=_MARKER,
restricted=0): restricted=0):
......
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