Commit 41a09523 authored by Julien Muchembled's avatar Julien Muchembled

ERP5Site_checkDataWithScript: return active process if created and make it callable from everywhere

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40419 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a29135f2
...@@ -74,6 +74,7 @@ considered if id_list is None.\n ...@@ -74,6 +74,7 @@ considered if id_list is None.\n
"""\n """\n
from Products.ERP5Type.Log import log\n from Products.ERP5Type.Log import log\n
document = context.getPortalObject()\n document = context.getPortalObject()\n
context = document.portal_activities\n
if relative_url:\n if relative_url:\n
document = document.restrictedTraverse(relative_url)\n document = document.restrictedTraverse(relative_url)\n
depth = len(relative_url.split(\'/\'))\n depth = len(relative_url.split(\'/\'))\n
...@@ -132,8 +133,9 @@ else:\n ...@@ -132,8 +133,9 @@ else:\n
except (TypeError, IndexError):\n except (TypeError, IndexError):\n
pass\n pass\n
\n \n
result = None\n
if active_process is None:\n if active_process is None:\n
active_process = context.newActiveProcess().getPath()\n result = active_process = context.newActiveProcess().getPath()\n
kw = dict(relative_url=relative_url, active_process=active_process,\n kw = dict(relative_url=relative_url, active_process=active_process,\n
tag=tag, full=full, recursive=recursive, packet=packet,\n tag=tag, full=full, recursive=recursive, packet=packet,\n
method_id=method_id, method_kw=method_kw)\n method_id=method_id, method_kw=method_kw)\n
...@@ -146,6 +148,8 @@ else:\n ...@@ -146,6 +148,8 @@ else:\n
else:\n else:\n
kw[\'id_list\'] = tuple(id_list[i:i+packet])\n kw[\'id_list\'] = tuple(id_list[i:i+packet])\n
activate(priority=4).ERP5Site_checkDataWithScript(**kw)\n activate(priority=4).ERP5Site_checkDataWithScript(**kw)\n
# return the active process path if we created one\n
return result\n
]]></string> </value> ]]></string> </value>
...@@ -220,6 +224,7 @@ else:\n ...@@ -220,6 +224,7 @@ else:\n
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>TypeError</string> <string>TypeError</string>
<string>IndexError</string> <string>IndexError</string>
<string>result</string>
<string>dict</string> <string>dict</string>
<string>kw</string> <string>kw</string>
<string>i</string> <string>i</string>
......
1789 1790
\ 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