Commit 67b83597 authored by Jérome Perrin's avatar Jérome Perrin

check consistency using constraints when validating an account


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12643 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d146be5
...@@ -72,10 +72,13 @@ ...@@ -72,10 +72,13 @@
from Products.ERP5Type.Message import Message\n from Products.ERP5Type.Message import Message\n
\n \n
account = sci[\'object\']\n account = sci[\'object\']\n
N_ = lambda msgid: Message(\'erp5_uid\', msgid)\n N_ = lambda msgid: Message(\'erp5_ui\', msgid)\n
\n \n
if account.getGap() in (None, \'\') : \n if not account.getGap():\n
raise ValidationFailed(N_("GAP is unset."))\n raise ValidationFailed(N_("GAP is unset."))\n
\n
for err in account.checkConsistency():\n
raise ValidationFailed(N(err[4]))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -127,7 +130,9 @@ if account.getGap() in (None, \'\') : \n ...@@ -127,7 +130,9 @@ if account.getGap() in (None, \'\') : \n
<string>account</string> <string>account</string>
<string>N_</string> <string>N_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>None</string> <string>_getiter_</string>
<string>err</string>
<string>N</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
178 181
\ 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