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 @@ ...@@ -89,10 +89,9 @@
<value> <value>
<tuple> <tuple>
<list> <list>
<string>nexedi</string>
<string>acl_users</string> <string>acl_users</string>
</list> </list>
<string>ac</string> <string>aurel</string>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -610,7 +609,7 @@ ...@@ -610,7 +609,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>Python_magic</string> </key> <key> <string>Python_magic</string> </key>
<value> <string encoding="base64">O/INCg==</string> </value> <value> <string encoding="base64">bfINCg==</string> </value>
</item> </item>
<item> <item>
<key> <string>Script_magic</string> </key> <key> <string>Script_magic</string> </key>
...@@ -671,42 +670,45 @@ ...@@ -671,42 +670,45 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <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 listbox = state_change.kwargs.get(\'listbox\')\n
workflow_action = state_change.kwargs.get(\'workflow_action\')\n workflow_action = state_change.kwargs.get(\'workflow_action\')\n
\n \n
object_to_update = {}\n object_to_update = {}\n
for item in listbox:\n if listbox is not None and len(listbox) > 0:\n
if item[\'choice\']:\n for item in listbox:\n
object_to_update[item[\'listbox_key\']] = item[\'choice\']\n if item[\'choice\']:\n
object_to_update[item[\'listbox_key\']] = item[\'choice\']\n
\n \n
if workflow_action == \'install_action\':\n if workflow_action == \'install_action\':\n
business_template.install(force=0, object_to_update=object_to_update)\n business_template.install(force=0, object_to_update=object_to_update)\n
elif workflow_action == \'reinstall_action\':\n elif workflow_action == \'reinstall_action\':\n
business_template.reinstall(force=0, object_to_update=object_to_update)\n business_template.reinstall(force=0, object_to_update=object_to_update)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
<value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAAAoAAAALAAAAQwAA <value> <string encoding="base64">YwAAAAAAAAAAAQAAAEAAAABzDQAAAGQBAIQAAFoAAGQAAFMoAgAAAE5jAQAAAAwAAAAMAAAAQwAA
AHP8AAAAdAAAfAAAZAEAgwIAfQIAdAAAdAAAfAAAZAIAgwIAZAMAgwIAZAQAgwEAfQMAdAAAdAAA AHMgAQAAdAAAfAAAZAEAgwIAfQIAdAAAdAAAfAAAZAIAgwIAZAMAgwIAZAQAgwEAfQMAdAAAdAAA
fAAAZAIAgwIAZAMAgwIAZAUAgwEAfQQAaAAAfQUAeEoAdAYAfAMAgwEARF08AH0HAHQIAHwHAGQG fAAAZAIAgwIAZAMAgwIAZAUAgwEAfQQAaAAAfQUAfAMAdAYAagkAbxAAAXQHAHwDAIMBAGQGAGoE
AIMCAG8mAAF0CAB8BwBkBgCDAgB0CQB8BQCDAQB0CAB8BwBkBwCDAgA8cV4AAXFeAFd8BABkCABq AG9RAAF4SgB0CAB8AwCDAQBEXTwAfQkAdAoAfAkAZAcAgwIAbyYAAXQKAHwJAGQHAIMCAHQLAHwF
AgBvIAABdAAAfAIAZAkAgwIAZAoAZAsAZAwAfAUAgwACAW4uAAF8BABkDQBqAgBvIAABdAAAfAIA AIMBAHQKAHwJAGQIAIMCADxuAQABcX4AV24BAAF8BABkCQBqAgBvIAABdAAAfAIAZAoAgwIAZAsA
ZA4AgwIAZAoAZAsAZAwAfAUAgwACAW4BAAFkAABTKA8AAABOcwYAAABvYmplY3RzBgAAAGt3YXJn ZAYAZAwAfAUAgwACAW4uAAF8BABkDQBqAgBvIAABdAAAfAIAZA4AgwIAZAsAZAYAZAwAfAUAgwAC
c3MDAAAAZ2V0cwcAAABsaXN0Ym94cw8AAAB3b3JrZmxvd19hY3Rpb25zBg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Z2V0aXRlcl9z AFIUAAAAUhUAAAAoAAAAACgAAAAAcw8AAABTY3JpcHQgKFB5dGhvbil0GAAAAEJ1c2luZXNzVGVt
BAAAAGl0ZW1zCQAAAF9nZXRpdGVtX3MHAAAAX3dyaXRlXygAAAAAKAAAAABzDwAAAFNjcmlwdCAo cGxhdGVfaW5zdGFsbAEAAABzGAAAAA8BHgEeAgYBIAENAAkBDQEuAg0BIAENASgBAAAAUhYAAAAo
UHl0aG9uKXMdAAAAQnVzaW5lc3NUZW1wbGF0ZV9pbnN0YWxsYXRpb24BAAAAcxYAAAAPAR4BHgIG AQAAAFIWAAAAKAAAAAAoAAAAAHMPAAAAU2NyaXB0IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAAB0
AQ0ACQENASoCEAEdARABKAEAAABzHQAAAEJ1c2luZXNzVGVtcGxhdGVfaW5zdGFsbGF0aW9uKAEA AAAAAA==</string> </value>
AABzHQAAAEJ1c2luZXNzVGVtcGxhdGVfaW5zdGFsbGF0aW9uKAAAAAAoAAAAAHMPAAAAU2NyaXB0
IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value>
</item> </item>
<item> <item>
<key> <string>_filepath</string> </key> <key> <string>_filepath</string> </key>
...@@ -746,6 +748,8 @@ IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value> ...@@ -746,6 +748,8 @@ IChQeXRob24pcwgAAAA8bW9kdWxlPgEAAABzAAAAAA==</string> </value>
<string>listbox</string> <string>listbox</string>
<string>workflow_action</string> <string>workflow_action</string>
<string>object_to_update</string> <string>object_to_update</string>
<string>None</string>
<string>len</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>item</string> <string>item</string>
<string>_getitem_</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