Commit 2183aef7 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Workaround for portal_Categories/resource object while installing BM

parent 09b85674
...@@ -1990,7 +1990,7 @@ class TemplateTool (BaseTool): ...@@ -1990,7 +1990,7 @@ class TemplateTool (BaseTool):
classname = klass.__name__ classname = klass.__name__
obj_dict = object.__dict__.copy() obj_dict = object.__dict__.copy()
attr_set = {'_dav_writelocks', '_filepath', '_owner', '_related_index', attr_set = {'_dav_writelocks', '_filepath', '_owner', '_related_index',
'last_id', 'uid', 'last_id', 'uid', '_mt_index', '_count', '_tree',
'__ac_local_roles__', '__ac_local_roles_group_id_dict__'} '__ac_local_roles__', '__ac_local_roles_group_id_dict__'}
attr_set.update(('isIndexable',)) attr_set.update(('isIndexable',))
...@@ -2010,6 +2010,18 @@ class TemplateTool (BaseTool): ...@@ -2010,6 +2010,18 @@ class TemplateTool (BaseTool):
# Raise an error # Raise an error
continue continue
# Special case for configuration instance attributes
if attr in ['_config', '_config_metadata']:
import collections
# Order the dictionary so that comparison can be correct
obj_dict[attr] = collections.OrderedDict(sorted(obj_dict[attr].items()))
if 'valid_tags' in obj_dict[attr]:
try:
obj_dict[attr]['valid_tags'] = collections.OrderedDict(sorted(obj_dict[attr]['valid_tags'].items()))
except AttributeError:
# This can occur in case the valid_tag object is PersistentList
pass
if 'data' in obj_dict: if 'data' in obj_dict:
try: try:
obj_dict['data'] = obj_dict.get('data').__dict__ obj_dict['data'] = obj_dict.get('data').__dict__
......
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