Commit 017ab891 authored by Ayush Tiwari's avatar Ayush Tiwari Committed by Ayush Tiwari

bt5_config: Rename properties to not have conflicts

parent d0657be9
......@@ -339,7 +339,6 @@ class BusinessManager(Folder):
for path_item in path_item_list:
if '#' in str(path_item[0]):
import pdb; pdb.set_trace()
PathItem = self.newContent(portal_type='Business Property Item')
# If its a property, no need to resolve the path
PathItem.edit(
......@@ -922,18 +921,18 @@ class BusinessPropertyItem(XMLObject):
obj = p.unrestrictedTraverse(relative_url)
property_value = obj.getProperty(property_id)
property_type = obj.getPropertyType(property_id)
self.setProperty('name', property_id)
self.setProperty('type', property_type)
self.setProperty('value', property_value)
self.setProperty('item_property_name', property_id)
self.setProperty('item_property_type', property_type)
self.setProperty('item_property_value', property_value)
def install(self, context):
portal = context.getPortalObject()
path = self.getProperty('item_path')
relative_url, property_id = path.split('#')
obj = portal.unrestrictedTraverse(relative_url)
property_name = self.getProperty('name')
property_type = self.getProperty('type')
property_value = self.getProperty('value')
property_name = self.getProperty('item_property_name')
property_type = self.getProperty('item_property_type')
property_value = self.getProperty('item_property_value')
# First remove the property from the existing path and keep the default
# empty, and update only if the sign is +1
obj._delPropValue(property_name)
......
......@@ -1776,12 +1776,14 @@ class TemplateTool (BaseTool):
# Update hashes of item in old state before installation
for item in old_installation_state.objectValues():
if item.isProperty:
value_list = item.getProperty('value')
value = item.getProperty('item_property_value')
else:
value_list = item.objectValues()
if value_list:
value = value_list[0]
if value:
item.setProperty('item_sha', self.calculateComparableHash(
value_list[0],
value,
item.isProperty,
))
......@@ -1791,9 +1793,8 @@ class TemplateTool (BaseTool):
# If the path has been removed, then add it with sign = -1
old_item = old_installation_state.getBusinessItemByPath(item.getProperty('item_path'))
# Calculate sha for the items in new_insatallation_state
import pdb; pdb.set_trace()
if item.isProperty:
value = item.getProperty('value')
value = item.getProperty('item_property_value')
else:
value = item.objectValues()[0]
item.setProperty('item_sha', self.calculateComparableHash(
......@@ -1956,6 +1957,7 @@ class TemplateTool (BaseTool):
# XXX: Hack for not trying to install the sub-objects from zexp,
# This should rather be implemented while exporting the object,
# where we shouldn't export sub-objects in the zexp
if not isProperty:
try:
value = new_item.objectValues()[0]
except IndexError:
......
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