From c97b90446312bb4bc1658bbd5fafcce212a00006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 4 Nov 2015 16:58:16 +0100 Subject: [PATCH] form: correctly ignore empty values in WidgetList (#8866) (it used to ignore None but we also want it to ignore '') --- wcs/qommon/form.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/wcs/qommon/form.py b/wcs/qommon/form.py index 1bf867a..e79605e 100644 --- a/wcs/qommon/form.py +++ b/wcs/qommon/form.py @@ -1179,6 +1179,15 @@ class WidgetList(quixote.form.widget.WidgetList): r += self.render_hint(self.get_hint()) return r.getvalue() + def _parse(self, request): + values = [] + for name in self.element_names: + value = self.get(name) + if value: + values.append(value) + self.value = values or None + + class WidgetDict(quixote.form.widget.WidgetDict): # Fix the title and hint setting # FIXME: to be fixed in Quixote upstream : title and hint parameters should be removed -- 2.6.2