Commit c3109f1b authored by Benjamin Blanc's avatar Benjamin Blanc

erp5_scalability_data: validate rules in portal_rules at init.

parent 8098a61b
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal = context.getPortalObject()\n <value> <string>portal = context.getPortalObject()\n
\n \n
\n
# Update roles\n # Update roles\n
portal_type = portal.searchFolder(title=\'portal_types\')[0]\n portal_type = portal.searchFolder(title=\'portal_types\')[0]\n
portal_type.searchFolder(title=\'Person\')[0].updateRoleMapping()\n portal_type.searchFolder(title=\'Person\')[0].updateRoleMapping()\n
...@@ -73,7 +72,6 @@ for i in xrange(0,350):\n ...@@ -73,7 +72,6 @@ for i in xrange(0,350):\n
new_user.validate()\n new_user.validate()\n
assignment = new_user.objectValues(portal_type=\'Assignment\')[0]\n assignment = new_user.objectValues(portal_type=\'Assignment\')[0]\n
assignment.open()\n assignment.open()\n
return 1\n
\n \n
# Update roles\n # Update roles\n
portal_type = portal.searchFolder(title=\'portal_types\')[0]\n portal_type = portal.searchFolder(title=\'portal_types\')[0]\n
...@@ -81,6 +79,15 @@ portal_type.searchFolder(title=\'Person\')[0].updateRoleMapping()\n ...@@ -81,6 +79,15 @@ portal_type.searchFolder(title=\'Person\')[0].updateRoleMapping()\n
portal_type.searchFolder(title=\'Product\')[0].updateRoleMapping()\n portal_type.searchFolder(title=\'Product\')[0].updateRoleMapping()\n
portal_type.searchFolder(title=\'Organisation\')[0].updateRoleMapping()\n portal_type.searchFolder(title=\'Organisation\')[0].updateRoleMapping()\n
portal_type.searchFolder(title=\'Sale Trade Condition\')[0].updateRoleMapping()\n portal_type.searchFolder(title=\'Sale Trade Condition\')[0].updateRoleMapping()\n
\n
# Validate rules in portal_rules\n
portal_rules = portal.portal_rules\n
for rule in portal_rules.searchFolder(validation_state = "draft"):\n
rule.validate()\n
\n
\n
# Return 1, at the end of the script.\n
return 1\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
18 19
\ No newline at end of file \ No newline at end of file
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