diff captchamiddleware/middleware.py @ 1:478d13061336

include a text input
author k0s <k0scist@gmail.com>
date Sat, 06 Feb 2010 19:00:32 -0500
parents 21ec6325ae0e
children c861518b2a44
line wrap: on
line diff
--- a/captchamiddleware/middleware.py	Sun Jan 24 23:15:57 2010 -0500
+++ b/captchamiddleware/middleware.py	Sat Feb 06 19:00:32 2010 -0500
@@ -64,7 +64,7 @@
             key = random.Random().randint(0, len(self.words))
             word = self.words[key]
             captcha = skimpyAPI.Pre(word).data()
-            string = '<div class="captcha">%s<input type="hidden" value="%s"/></div>' % (captcha, key)
+            string = '<div class="captcha">%s<input type="hidden" value="%s"/><input type="text" name="captcha"/></div>' % (captcha, key)
             addition = etree.fromstring(string)
             insertion_point = element.find('.' + self.path)
             insertion_point.addprevious(addition)