Commit 61b9f8d9 authored by Fabien Morin's avatar Fabien Morin

Add use_list and clean the script :

- use default values [] for preferences.
- use only one edit, and no if

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32141 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0b95fe97
......@@ -55,17 +55,15 @@
<key> <string>_body</string> </key>
<value> <string>portal_type = context.getPortalType().lower().replace(\' \', \'_\')\n
\n
base = context.portal_preferences.getPreference(\'preferred_%s_variation_base_category_list\' % portal_type)\n
optional = context.portal_preferences.getPreference(\'preferred_%s_optional_variation_base_category_list\' % portal_type)\n
individual = context.portal_preferences.getPreference(\'preferred_%s_individual_variation_base_category_list\' % portal_type)\n
base = context.portal_preferences.getPreference(\'preferred_%s_variation_base_category_list\' % portal_type, [])\n
optional = context.portal_preferences.getPreference(\'preferred_%s_optional_variation_base_category_list\' % portal_type, [])\n
individual = context.portal_preferences.getPreference(\'preferred_%s_individual_variation_base_category_list\' % portal_type, [])\n
use_list = context.portal_preferences.getPreference(\'preferred_%s_use_list\' % portal_type, [])\n
\n
if individual:\n
context.edit(variation_base_category_list=base,\n
optional_variation_base_category_list=optional,\n
individual_variation_base_category_list=individual)\n
else:\n
context.edit(variation_base_category_list=base,\n
optional_variation_base_category_list=optional)\n
context.edit(variation_base_category_list=base,\n
optional_variation_base_category_list=optional,\n
individual_variation_base_category_list=individual,\n
use_list=use_list)\n
</string> </value>
</item>
<item>
......@@ -110,6 +108,7 @@ else:\n
<string>base</string>
<string>optional</string>
<string>individual</string>
<string>use_list</string>
</tuple>
</value>
</item>
......
433
\ No newline at end of file
436
\ 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