From 573564ad456fb25eb9f53f10815168e7bc4cae1f Mon Sep 17 00:00:00 2001 From: Nicolas Dumazet <nicolas.dumazet@nexedi.com> Date: Wed, 1 Dec 2010 01:49:39 +0000 Subject: [PATCH] passing id='' or id=None is nonsense git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40942 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/ERP5Type.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/product/ERP5Type/ERP5Type.py b/product/ERP5Type/ERP5Type.py index 475a10cc2b..8267a6c336 100644 --- a/product/ERP5Type/ERP5Type.py +++ b/product/ERP5Type/ERP5Type.py @@ -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()) -- 2.30.9