[Erp5-report] r18719 - /erp5/trunk/products/ERP5/Document/BusinessTemplate.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jan 15 14:28:13 CET 2008


Author: romain
Date: Tue Jan 15 14:28:11 2008
New Revision: 18719

URL: http://svn.erp5.org?rev=18719&view=rev
Log:
Improve error message.

Modified:
    erp5/trunk/products/ERP5/Document/BusinessTemplate.py

Modified: erp5/trunk/products/ERP5/Document/BusinessTemplate.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/BusinessTemplate.py?rev=18719&r1=18718&r2=18719&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/BusinessTemplate.py (original)
+++ erp5/trunk/products/ERP5/Document/BusinessTemplate.py Tue Jan 15 14:28:11 2008
@@ -1586,6 +1586,12 @@
             chain_dict['chain_%s' % portal_type] = ', '.join(
                                               old_chain_workflow_id_set.keys())
           else:
+            # Check if it has normally to remove a workflow chain, in order to
+            # improve the error message
+            for wf_id in self._objects[path].split(', '):
+              if wf_id.startswith('-'):
+                raise ValueError, '"%s" is not a workflow ID for %s' % \
+                                  (wf_id, portal_type)
             chain_dict['chain_%s' % portal_type] = self._objects[path]
         else:
           chain_dict['chain_%s' % portal_type] = self._objects[path]




More information about the Erp5-report mailing list