[Erp5-report] r43845 jerome - /erp5/trunk/products/ERP5/Tool/IdTool.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Mar 1 11:08:56 CET 2011
Author: jerome
Date: Tue Mar 1 11:08:56 2011
New Revision: 43845
URL: http://svn.erp5.org?rev=43845&view=rev
Log:
generateNewLengthId was generating an extra warning because it was using
passing store=1 even if the caller did not pass it
Modified:
erp5/trunk/products/ERP5/Tool/IdTool.py
Modified: erp5/trunk/products/ERP5/Tool/IdTool.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Tool/IdTool.py?rev=43845&r1=43844&r2=43845&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Tool/IdTool.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Tool/IdTool.py [utf8] Tue Mar 1 11:08:56 2011
@@ -350,7 +350,7 @@ class IdTool(BaseTool):
security.declareProtected(Permissions.AccessContentsInformation,
'generateNewLengthId')
- def generateNewLengthId(self, id_group=None, default=None, store=1):
+ def generateNewLengthId(self, id_group=None, default=None, store=_marker):
"""
Generates an Id.
See generateNewLengthIdList documentation for details.
@@ -358,9 +358,11 @@ class IdTool(BaseTool):
warnings.warn('generateNewLengthId is deprecated.\n'
'Use generateNewIdList with a sql id_generator',
DeprecationWarning)
- new_id = self.generateNewIdList(id_group=id_group,
- id_count=1, default=default, store=store)[0]
- return new_id
+ if store is not _marker:
+ return self.generateNewIdList(id_group=id_group,
+ id_count=1, default=default, store=store)[0]
+ return self.generateNewIdList(id_group=id_group,
+ id_count=1, default=default)[0]
security.declareProtected(Permissions.AccessContentsInformation,
'getDictLengthIdsItems')
More information about the Erp5-report
mailing list