Commit e7be2a3d authored by Nicolas Dumazet's avatar Nicolas Dumazet

invert comparison to lose one level of indentation


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41738 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0a9b2d80
......@@ -1358,7 +1358,9 @@ def setDefaultProperties(property_holder, object=None, portal=None):
Permissions.ModifyPortalContent)
if isinstance(write_permission, Expression):
write_permission = write_permission(econtext)
if prop['type'] in type_definition:
if prop['type'] not in type_definition:
raise TypeError, '"%s" is invalid type for propertysheet' % \
prop['type']
if 'base_id' in prop:
continue
if not converted_prop_keys.has_key(prop['id']):
......@@ -1435,9 +1437,6 @@ def setDefaultProperties(property_holder, object=None, portal=None):
read_permission=read_permission,
write_permission=write_permission,
portal=portal)
else:
raise TypeError, '"%s" is invalid type for propertysheet' % \
prop['type']
# Create Category Accessors
for cat in cat_list:
# Create free text accessors.
......@@ -1560,7 +1559,9 @@ def setDefaultProperties(property_holder, object=None, portal=None):
# We remove such properties here
#from Base import Base as BaseClass
for prop in converted_prop_list:
if prop['type'] in type_definition:
if prop['type'] not in type_definition:
raise TypeError, '"%s" is invalid type for propertysheet' % \
prop['type']
#if not hasattr(property_holder, prop['id']):
# setattr(property_holder, prop['id'], None) # This makes sure no acquisition will happen
# but is wrong when we use storage_id .....
......@@ -1576,9 +1577,6 @@ def setDefaultProperties(property_holder, object=None, portal=None):
#else:
# # setattr(property_holder, prop['id'], defaults[prop['type']])
# pass
else:
raise TypeError, '"%s" is invalid type for propertysheet' % \
prop['type']
# Create for every portal type group an accessor (like isPortalDeliveryType)
# In the future, this should probalby use categories
......
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