changeset 3299:34d225168d14

fix textcha in newaccount action
author Johannes Berg <johannes AT sipsolutions DOT net>
date Tue, 18 Mar 2008 15:31:17 +0100
parents 4d76c1409694
children f048c3edc164
files MoinMoin/action/newaccount.py
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/newaccount.py	Tue Mar 18 13:05:13 2008 +0100
+++ b/MoinMoin/action/newaccount.py	Tue Mar 18 15:31:17 2008 +0100
@@ -129,15 +129,16 @@
     row.append(html.TD().append(html.INPUT(type="text", size="36",
                                            name="email")))
 
-    row = html.TR()
-    tbl.append(row)
-    row.append(html.TD().append(html.STRONG().append(
-                                  html.Text(_('TextCha (required)')))))
-    td = html.TD()
-    textcha = TextCha(request).render()
-    if textcha:
-        td.append(textcha)
-    row.append(td)
+    textcha = TextCha(request)
+    if textcha.is_enabled():
+        row = html.TR()
+        tbl.append(row)
+        row.append(html.TD().append(html.STRONG().append(
+                                      html.Text(_('TextCha (required)')))))
+        td = html.TD()
+        if textcha:
+            td.append(textcha.render())
+        row.append(td)
 
     row = html.TR()
     tbl.append(row)