Commit 2b704d55 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Set the default predicate at the root and fix missing assignment.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16610 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a5269028
...@@ -131,6 +131,7 @@ def createWebSectionFromCategoryValue(container, category, depth, section_id=Non ...@@ -131,6 +131,7 @@ def createWebSectionFromCategoryValue(container, category, depth, section_id=Non
, membership_criterion_base_category = (base_category_id,)\n , membership_criterion_base_category = (base_category_id,)\n
, membership_criterion_category = (category_url,)\n , membership_criterion_category = (category_url,)\n
)\n )\n
new_section.updateLocalRolesOnSecurityGroups()\n
except ConflictError:\n except ConflictError:\n
raise\n raise\n
except:\n except:\n
...@@ -142,7 +143,7 @@ def createWebSectionFromCategoryValue(container, category, depth, section_id=Non ...@@ -142,7 +143,7 @@ def createWebSectionFromCategoryValue(container, category, depth, section_id=Non
if category.getPortalType() not in (\'Category\', \'Base Category\'):\n if category.getPortalType() not in (\'Category\', \'Base Category\'):\n
category_url = \'%s/%s\' % (base_category_id, category.getRelativeUrl())\n category_url = \'%s/%s\' % (base_category_id, category.getRelativeUrl())\n
else:\n else:\n
category.getRelativeUrl()\n category_url = category.getRelativeUrl()\n
if update_existing:\n if update_existing:\n
new_section.edit(title = category.getTitle()\n new_section.edit(title = category.getTitle()\n
, description = category.getDescription()\n , description = category.getDescription()\n
...@@ -150,6 +151,7 @@ def createWebSectionFromCategoryValue(container, category, depth, section_id=Non ...@@ -150,6 +151,7 @@ def createWebSectionFromCategoryValue(container, category, depth, section_id=Non
, membership_criterion_base_category = (base_category_id,)\n , membership_criterion_base_category = (base_category_id,)\n
, membership_criterion_category = (category_url,)\n , membership_criterion_category = (category_url,)\n
)\n )\n
new_section.updateLocalRolesOnSecurityGroups()\n
# Call the function recursively\n # Call the function recursively\n
if new_section is not None:\n if new_section is not None:\n
# It is possible to browse objects which are not categories\n # It is possible to browse objects which are not categories\n
...@@ -167,6 +169,19 @@ my_category_value = category_tool.restrictedTraverse(category)\n ...@@ -167,6 +169,19 @@ my_category_value = category_tool.restrictedTraverse(category)\n
base_category_id = my_category_value.getBaseCategory().getId()\n base_category_id = my_category_value.getBaseCategory().getId()\n
createWebSectionFromCategoryValue(context, my_category_value, depth, section_id=section_id)\n createWebSectionFromCategoryValue(context, my_category_value, depth, section_id=section_id)\n
\n \n
# Update section settings\n
if update_existing:\n
section_value = getattr(context, section_id)\n
if \'/\' in category:\n
category_url = category\n
else:\n
# use the base category as a category to select all\n
category_url = \'%s/%s\' % (category, category) \n
section_value.edit(membership_criterion_base_category = (base_category_id,),\n
membership_criterion_category = (category_url,))\n
section_value.updateLocalRolesOnSecurityGroups()\n
\n
\n
# Warn about failures if any\n # Warn about failures if any\n
if failed_list:\n if failed_list:\n
return context.Base_redirect(form_id,\n return context.Base_redirect(form_id,\n
...@@ -249,6 +264,9 @@ return context.Base_redirect(form_id,\n ...@@ -249,6 +264,9 @@ return context.Base_redirect(form_id,\n
<string>base_category_id</string> <string>base_category_id</string>
<string>createWebSectionFromCategoryValue</string> <string>createWebSectionFromCategoryValue</string>
<string>my_category_value</string> <string>my_category_value</string>
<string>getattr</string>
<string>section_value</string>
<string>category_url</string>
<string>dict</string> <string>dict</string>
</tuple> </tuple>
</value> </value>
......
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