From 83d8df3bed38e51bf7924824580379c076fe601f Mon Sep 17 00:00:00 2001 From: Moritz Schlarb Date: Sun, 4 Nov 2012 18:37:36 +0100 Subject: [PATCH] Make twf.Label validate to twc.EmptyField Just the same as twf.Space. Otherwise, the validates results will include a None key which makes e.g. TurboGears2 choke if the dict is passed as method kwargs. --- tw2/forms/widgets.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tw2/forms/widgets.py b/tw2/forms/widgets.py index c6e434d..2f08a92 100755 --- a/tw2/forms/widgets.py +++ b/tw2/forms/widgets.py @@ -638,6 +638,9 @@ class Label(twc.Widget): label = None id = None + def _validate(self, value, state=None): + return twc.EmptyField + class Form(twc.DisplayOnlyWidget): """