Commit d98f860b authored by Nicolas Dumazet's avatar Nicolas Dumazet

be nicer if portal_categories does not exist.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42442 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e054a90e
......@@ -1546,12 +1546,15 @@ def setDefaultProperties(property_holder, object=None, portal=None):
else:
base_category_list.append(cat)
for cat in base_category_list:
# Get read and write permission
if portal is not None:
cat_object = portal.portal_categories.get(cat, None)
portal_categories = getattr(portal, 'portal_categories', None)
else:
portal_categories = None
for cat in base_category_list:
# Get read and write permission
cat_object = None
if portal_categories is not None:
cat_object = portal_categories.get(cat, None)
if cat_object is not None:
read_permission = Permissions.__dict__.get(
cat_object.getReadPermission(),
......
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