From 19bf43815dcd6050146cfa100d1c3321ec5306e4 Mon Sep 17 00:00:00 2001 From: mdipierro Date: Thu, 27 Sep 2012 21:45:19 -0500 Subject: [PATCH] added better comments to address issue 1033 --- VERSION | 2 +- gluon/sqlhtml.py | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 192fff3e..07c2646f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.9 (2012-09-27 15:12:31) stable +Version 2.0.9 (2012-09-27 21:45:13) stable diff --git a/gluon/sqlhtml.py b/gluon/sqlhtml.py index f560b912..7589d09e 100644 --- a/gluon/sqlhtml.py +++ b/gluon/sqlhtml.py @@ -379,12 +379,11 @@ class CheckboxesWidget(OptionsWidget): requires = field.requires if not isinstance(requires, (list, tuple)): requires = [requires] - if requires: - if hasattr(requires[0], 'options'): - options = requires[0].options() - else: - raise SyntaxError, 'widget cannot determine options of %s' \ - % field + if requires and hasattr(requires[0], 'options'): + options = requires[0].options() + else: + raise SyntaxError, 'widget cannot determine options of %s' \ + % field options = [(k, v) for k, v in options if k != ''] opts = []