Commit 932d1d1d authored by Vincent Pelletier's avatar Vincent Pelletier

ERP5.Tool.CategoryTool, Folder: Do not copy over special and ClassSecurityInfo attributes.

parent cfd807ca
......@@ -158,12 +158,14 @@ class CategoryTool(CMFCategoryTool, BaseTool):
# inherits from via BaseTool) and CMFCategoryTool in favour of the property
# from BaseTool (so it may override CopyContainer).
for CopyContainer_property_id in CopyContainer.__dict__:
if CopyContainer_property_id in CategoryTool.__dict__:
if CopyContainer_property_id.startswith('__') or CopyContainer_property_id in CategoryTool.__dict__:
continue
try:
BaseTool_property = getattr(BaseTool, CopyContainer_property_id)
except AttributeError:
continue
if isinstance(BaseTool_property, ClassSecurityInfo):
continue
setattr(CategoryTool, CopyContainer_property_id, BaseTool_property)
InitializeClass( CategoryTool )
......@@ -1720,10 +1720,12 @@ for source_klass, destination_klass in \
# inherits from via Base) and those bases in favour of the property
# from Base (so it may override CopyContainer).
for CopyContainer_property_id in CopyContainer.__dict__:
if CopyContainer_property_id in Folder.__dict__:
if CopyContainer_property_id.startswith('__') or CopyContainer_property_id in Folder.__dict__:
continue
try:
Base_property = getattr(Base, CopyContainer_property_id)
except AttributeError:
continue
if isinstance(Base_property, ClassSecurityInfo):
continue
setattr(Folder, CopyContainer_property_id, Base_property)
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