From 33dbc019704493f3e3ec3674fc46ee128196535d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 12 Aug 2009 13:06:52 +0000
Subject: [PATCH] as getResultValue only returns the first value, we can limit
 to the first result

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28353 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Catalog/CatalogTool.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5Catalog/CatalogTool.py b/product/ERP5Catalog/CatalogTool.py
index 0d520574e1..57769fa1bc 100644
--- a/product/ERP5Catalog/CatalogTool.py
+++ b/product/ERP5Catalog/CatalogTool.py
@@ -724,6 +724,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
         A method to factor common code used to search a single
         object in the database.
         """
+        kw.setdefault('limit', 1)
         result = self.searchResults(query=query, **kw)
         try:
           return result[0].getObject()
@@ -737,6 +738,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
         object in the database. Same as getResultValue but without
         taking into account security.
         """
+        kw.setdefault('limit', 1)
         result = self.unrestrictedSearchResults(query=query, **kw)
         try:
           return result[0].getObject()
-- 
2.30.9