From 69a0b2c3ac258f78c4f8af917d6fa0dedea7bc5a Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent@nexedi.com>
Date: Fri, 8 Sep 2006 12:03:37 +0000
Subject: [PATCH] Raise KeyError when the listbox is not found in the request.
 This exception is then handled in ERP5Form/Field.py.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9763 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Form/ListBox.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py
index 95b239044a..32c5bb40c5 100644
--- a/product/ERP5Form/ListBox.py
+++ b/product/ERP5Form/ListBox.py
@@ -2732,7 +2732,10 @@ class ListBoxValidator(Validator.Validator):
 
         result = {}
         error_result = {}
-        listbox_uids = REQUEST.get('%s_uid' % field.id, [])
+        MARKER = []
+        listbox_uids = REQUEST.get('%s_uid' % field.id, MARKER)
+        if listbox_uids is MARKER:
+          raise KeyError, 'Field %s is not present in request object.' % (field.id, )
         #LOG('ListBox.validate: REQUEST',0,REQUEST)
         errors = []
         object_list = []
-- 
2.30.9