diff captchamiddleware/example.py @ 4:ce757057961c

flow contol now works; bumping version
author k0s <k0scist@gmail.com>
date Wed, 24 Feb 2010 20:11:25 -0500
parents c861518b2a44
children
line wrap: on
line diff
--- a/captchamiddleware/example.py	Tue Feb 23 20:08:22 2010 -0500
+++ b/captchamiddleware/example.py	Wed Feb 24 20:11:25 2010 -0500
@@ -3,7 +3,12 @@
 from paste.httpexceptions import HTTPExceptionHandler
 
 def example_app(environ, start_response):
-    return Response('<html><body><p>method=%s</p><form method="post">Hello, world!<input type="submit"/></form></body></html>' % environ['REQUEST_METHOD'])(environ, start_response)
+    method = environ['REQUEST_METHOD']
+    form = ''
+    if method != 'POST':
+        form = '<form method="post">Hello, world!<input type="submit"/></form>'
+
+    return Response('<html><body><p>method=%s</p>%s</body></html>' % (method, form))(environ, start_response)
 
 
 def factory(global_conf, **app_conf):