--- a/src/pyams_form/group.py Tue Jun 12 10:49:14 2018 +0200
+++ b/src/pyams_form/group.py Thu Jun 14 08:57:33 2018 +0200
@@ -179,18 +179,19 @@
def groups(self):
result = self._groups[:]
others = []
- for widget in self.widgets.values():
- found = False
- for group in result:
- if widget in group.widgets:
- found = True
- break
- if not found:
- others.append(widget)
- if others:
- result.insert(0, FormWidgetsGroup(self, None, others,
- legend=self.main_group_legend,
- css_class=self.main_group_class))
+ if self.widgets:
+ for widget in self.widgets.values():
+ found = False
+ for group in result:
+ if widget in group.widgets:
+ found = True
+ break
+ if not found:
+ others.append(widget)
+ if others:
+ result.insert(0, FormWidgetsGroup(self, None, others,
+ legend=self.main_group_legend,
+ css_class=self.main_group_class))
return result
def updateGroups(self):