Commit bcd8dad9 authored by Jérome Perrin's avatar Jérome Perrin

clear cache when validating an account. Use Message API in validation script

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@7505 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent edb7df29
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
<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>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>Script_magic</string> </key> <key> <string>Script_magic</string> </key>
...@@ -67,10 +69,13 @@ ...@@ -67,10 +69,13 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n <value> <string>from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import Message\n
\n
account = sci[\'object\']\n account = sci[\'object\']\n
N_ = lambda msgid: Message(\'erp5_uid\', msgid)\n
\n \n
if account.getGap() in (None, \'\') : \n if account.getGap() in (None, \'\') : \n
raise ValidationFailed, account.Base_TranslateString("GAP is unset.")\n raise ValidationFailed(N_("GAP is unset."))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -114,8 +119,11 @@ if account.getGap() in (None, \'\') : \n ...@@ -114,8 +119,11 @@ if account.getGap() in (None, \'\') : \n
<string>sci</string> <string>sci</string>
<string>Products.DCWorkflow.DCWorkflow</string> <string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string> <string>ValidationFailed</string>
<string>Products.ERP5Type.Message</string>
<string>Message</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>account</string> <string>account</string>
<string>N_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>None</string> <string>None</string>
</tuple> </tuple>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<tuple>
<string>Products.PythonScripts.PythonScript</string>
<string>PythonScript</string>
</tuple>
<none/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"""Clear the cache when validating a new account, for scripts showing a cached\n
list of accounts.\n
"""\n
from Products.ERP5Type.Cache import clearCache\n
clearCache()\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value> <string>Script (Python):/nexedi/portal_workflow/account_workflow/scripts/clearCache</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>sci</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>sci</string>
<string>Products.ERP5Type.Cache</string>
<string>clearCache</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>clearCache</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</item> </item>
<item> <item>
<key> <string>after_script_name</string> </key> <key> <string>after_script_name</string> </key>
<value> <string></string> </value> <value> <string>clearCache</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
......
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