do not write -invalid- empty table row when form has no buttons stable
authorFlorent <florent@secondweb.fr>
Tue, 23 Jun 2009 15:37:51 +0200
branchstable
changeset 2148 2b2b9626a98f
parent 2147 476a75ede2cc
child 2149 6a631ec5cc71
do not write -invalid- empty table row when form has no buttons
web/views/formrenderers.py
--- a/web/views/formrenderers.py	Tue Jun 23 13:46:18 2009 +0200
+++ b/web/views/formrenderers.py	Tue Jun 23 15:37:51 2009 +0200
@@ -206,6 +206,8 @@
         w(u'</table>')
 
     def render_buttons(self, w, form):
+        if not form.form_buttons:
+            return
         w(u'<table class="%s">\n<tr>\n' % self.button_bar_class)
         for button in form.form_buttons:
             w(u'<td>%s</td>\n' % button.render(form))