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 @@ ...@@ -55,17 +55,15 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal_type = context.getPortalType().lower().replace(\' \', \'_\')\n <value> <string>portal_type = context.getPortalType().lower().replace(\' \', \'_\')\n
\n \n
base = context.portal_preferences.getPreference(\'preferred_%s_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 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 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 \n
if individual:\n context.edit(variation_base_category_list=base,\n
context.edit(variation_base_category_list=base,\n optional_variation_base_category_list=optional,\n
optional_variation_base_category_list=optional,\n individual_variation_base_category_list=individual,\n
individual_variation_base_category_list=individual)\n use_list=use_list)\n
else:\n
context.edit(variation_base_category_list=base,\n
optional_variation_base_category_list=optional)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -110,6 +108,7 @@ else:\n ...@@ -110,6 +108,7 @@ else:\n
<string>base</string> <string>base</string>
<string>optional</string> <string>optional</string>
<string>individual</string> <string>individual</string>
<string>use_list</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
433 436
\ 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