Commit ea224fa7 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Base_getWorkflowHistory and Base_getWorkflowHistoryItemList should not return...

Base_getWorkflowHistory and Base_getWorkflowHistoryItemList should not return workflow histories that does not exist in the workflow chain.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24853 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3382df0c
...@@ -61,14 +61,16 @@ history_name_list = [\'building_history\', \' installation_history\', \'history\ ...@@ -61,14 +61,16 @@ history_name_list = [\'building_history\', \' installation_history\', \'history\
\n \n
history = {}\n history = {}\n
\n \n
portal_workflow = context.getPortalObject().portal_workflow\n
workflow_id_list = [x.getId() for x in portal_workflow.getWorkflowsFor(context)]\n
\n \n
for history_name in history_name_list:\n for history_name in history_name_list:\n
\n \n
for wf_id in context.getWorkflowIds():\n for wf_id in workflow_id_list:\n
\n \n
list_history_item = None\n list_history_item = None\n
try:\n try:\n
list_history_item = context.portal_workflow.getInfoFor(ob=context, name=history_name, wf_id=wf_id)\n list_history_item = portal_workflow.getInfoFor(ob=context, name=history_name, wf_id=wf_id)\n
except ConflictError:\n except ConflictError:\n
raise\n raise\n
except:\n except:\n
...@@ -140,10 +142,15 @@ return history\n ...@@ -140,10 +142,15 @@ return history\n
<string>ConflictError</string> <string>ConflictError</string>
<string>history_name_list</string> <string>history_name_list</string>
<string>history</string> <string>history</string>
<string>_getiter_</string>
<string>history_name</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>portal_workflow</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>x</string>
<string>workflow_id_list</string>
<string>history_name</string>
<string>wf_id</string> <string>wf_id</string>
<string>None</string> <string>None</string>
<string>list_history_item</string> <string>list_history_item</string>
......
...@@ -61,6 +61,10 @@ marker = []\n ...@@ -61,6 +61,10 @@ marker = []\n
result = []\n result = []\n
i = 1\n i = 1\n
portal_object = context.getPortalObject()\n portal_object = context.getPortalObject()\n
portal_workflow = portal_object.portal_workflow\n
workflow_id_list = [x.getId() for x in portal_workflow.getWorkflowsFor(context)]\n
if not workflow_id in workflow_id_list:\n
return []\n
# Get history\n # Get history\n
# XXX Compatibility\n # XXX Compatibility\n
for history_name in [\'history\', \'building_history\', \'installation_history\']:\n for history_name in [\'history\', \'building_history\', \'installation_history\']:\n
...@@ -186,7 +190,12 @@ return result\n ...@@ -186,7 +190,12 @@ return result\n
<string>result</string> <string>result</string>
<string>i</string> <string>i</string>
<string>portal_object</string> <string>portal_object</string>
<string>portal_workflow</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>x</string>
<string>workflow_id_list</string>
<string>history_name</string> <string>history_name</string>
<string>workflow_item_list</string> <string>workflow_item_list</string>
<string>_getitem_</string> <string>_getitem_</string>
...@@ -204,9 +213,6 @@ return result\n ...@@ -204,9 +213,6 @@ return result\n
<string>compatibility_name</string> <string>compatibility_name</string>
<string>len</string> <string>len</string>
<string>same_type</string> <string>same_type</string>
<string>append</string>
<string>$append0</string>
<string>x</string>
<string>getattr</string> <string>getattr</string>
</tuple> </tuple>
</value> </value>
......
1034 1035
\ 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