Commit c0a82f7b authored by Jean-Paul Smets's avatar Jean-Paul Smets

fixed assertAttributePortalType which destroyed objects


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@959 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c1fbdd39
......@@ -1948,11 +1948,7 @@ def assertAttributePortalType(o, attribute_name, portal_type):
if hasattr(o,attribute_name):
try:
if type(portal_type) is type('a'): portal_type = [portal_type]
must_delete = 1
for pt in portal_type:
if getattr(o, attribute_name).portal_type == portal_type:
must_delete = 0
if must_delete:
if getattr(o, attribute_name).portal_type not in portal_type:
o._delObject(attribute_name)
except:
LOG("ERPType Warning: assertAttributePortalType",100,str(o.absolute_url()))
......
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