[Erp5-report] r40942 nicolas.dumazet - /erp5/trunk/products/ERP5Type/ERP5Type.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Dec 1 02:49:40 CET 2010


Author: nicolas.dumazet
Date: Wed Dec  1 02:49:39 2010
New Revision: 40942

URL: http://svn.erp5.org?rev=40942&view=rev
Log:
passing id='' or id=None is nonsense

Modified:
    erp5/trunk/products/ERP5Type/ERP5Type.py

Modified: erp5/trunk/products/ERP5Type/ERP5Type.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/ERP5Type.py?rev=40942&r1=40941&r2=40942&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] (original)
+++ erp5/trunk/products/ERP5Type/ERP5Type.py [utf8] Wed Dec  1 02:49:39 2010
@@ -336,6 +336,9 @@ class ERP5TypeInformation(XMLObject,
       Call the init_script for the portal_type.
       Returns the object.
       """
+      if id is None or len(id) == 0:
+        raise ValueError("invalid object id")
+
       if not temp_object and not self.isConstructionAllowed(container):
         raise AccessControl_Unauthorized('Cannot create %s' % self.getId())
 



More information about the Erp5-report mailing list