--- a/web/captcha.py Thu Feb 18 07:29:13 2010 +0100
+++ b/web/captcha.py Thu Feb 18 08:39:30 2010 +0100
@@ -17,8 +17,7 @@
from time import time
from cubicweb import tags
-from cubicweb.view import StartupView
-from cubicweb.web import httpcache, formwidgets as fw, formfields as ff
+from cubicweb.web import formwidgets as fw
def pil_captcha(text, fontfile, fontsize):
@@ -61,21 +60,6 @@
return text, out
-class CaptchaView(StartupView):
- __regid__ = 'captcha'
-
- http_cache_manager = httpcache.NoHTTPCacheManager
- binary = True
- templatable = False
- content_type = 'image/jpg'
-
- def call(self):
- text, data = captcha.captcha(self._cw.vreg.config['captcha-font-file'],
- self._cw.vreg.config['captcha-font-size'])
- self._cw.set_session_data('captcha', text)
- self.w(data.read())
-
-
class CaptchaWidget(fw.TextInput):
def render(self, form, field, renderer=None):
# t=int(time()*100) to make sure img is not cached