Commit 55c3b27d authored by Aurel's avatar Aurel

check listbox is not none or empty before retrieving object to install

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9992 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 0047f4ef
......@@ -89,10 +89,9 @@
<value>
<tuple>
<list>
<string>nexedi</string>
<string>acl_users</string>
</list>
<string>ac</string>
<string>aurel</string>
</tuple>
</value>
</item>
......@@ -610,7 +609,7 @@
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value>
<value> <string encoding="base64">bfINCg==</string> </value>
</item>
<item>
<key> <string>Script_magic</string> </key>
......@@ -671,42 +670,45 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>business_template = state_change.object\n
<value> <string encoding="cdata"><![CDATA[
business_template = state_change.object\n
listbox = state_change.kwargs.get(\'listbox\')\n
workflow_action = state_change.kwargs.get(\'workflow_action\')\n
\n
object_to_update = {}\n
for item in listbox:\n
if item[\'choice\']:\n
object_to_update[item[\'listbox_key\']] = item[\'choice\']\n
if listbox is not None and len(listbox) > 0:\n
for item in listbox:\n
if item[\'choice\']:\n
object_to_update[item[\'listbox_key\']] = item[\'choice\']\n
\n
if workflow_action == \'install_action\':\n
business_template.install(force=0, object_to_update=object_to_update)\n
elif workflow_action == \'reinstall_action\':\n
business_template.reinstall(force=0, object_to_update=object_to_update)\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAAAoAAAALAAAAQwAA
AHP8AAAAdAAAfAAAZAEAgwIAfQIAdAAAdAAAfAAAZAIAgwIAZAMAgwIAZAQAgwEAfQMAdAAAdAAA
fAAAZAIAgwIAZAMAgwIAZAUAgwEAfQQAaAAAfQUAeEoAdAYAfAMAgwEARF08AH0HAHQIAHwHAGQG
AIMCAG8mAAF0CAB8BwBkBgCDAgB0CQB8BQCDAQ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g8AAABSAwAAAFIEAAAAUgoAAABSEAAAAFIRAAAAUhIAAABSEwAA
AFIUAAAAUhUAAAAoAAAAACgAAAAAcw8AAABTY3JpcHQgKFB5dGhvbil0GAAAAEJ1c2luZXNzVGVt
cGxhdGVfaW5zdGFsbAEAAABzGAAAAA8BHgEeAgYBIAENAAkBDQEuAg0BIAENASgBAAAAUhYAAAAo
AQAAAFIWAAAAKAAAAAAoAAAAAHMPAAAAU2NyaXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAAB0
AAAAAA==</string> </value>
</item>
<item>
<key> <string>_filepath</string> </key>
......@@ -746,6 +748,8 @@ IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value>
<string>listbox</string>
<string>workflow_action</string>
<string>object_to_update</string>
<string>None</string>
<string>len</string>
<string>_getiter_</string>
<string>item</string>
<string>_getitem_</string>
......
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