There was a missing source line in 1.91.6 (and maybe others around the
time).
If you are running from source you can fix it by adding:

self.options = options

to the __init__ part of the Recaptcha class.

Or upgrade to a newer version.


On Mar 20, 7:44 am, Ed Greenberg <greenberg...@gmail.com> wrote:
> Following the book, I do this in db.py, after auth has been
> instantiated.
>
> from gluon.tools import Recaptcha
> auth.settings.captcha =
> Recaptcha(request,'6LczqcISA...cAoH','6L...L2')
>
> and I get a ticket:
> AttributeError: 'Recaptcha' object has no attribute 'options'
>
> Any ideas?  Traceback below.
>
> Ed G
>
> Traceback (most recent call last):
>   File "/opt/web-apps/web2py/gluon/restricted.py", line 188, in
> restricted
>     exec ccode in environment
>   File "/opt/web-apps/web2py/applications/gw/views/default/user.html",
> line 99, in <module>
>   File "/opt/web-apps/web2py/gluon/globals.py", line 104, in write
>     self.body.write(xmlescape(data))
>   File "/opt/web-apps/web2py/gluon/html.py", line 118, in xmlescape
>     data = str(data)
>   File "/opt/web-apps/web2py/gluon/html.py", line 797, in __str__
>     return self.xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 1769, in xml
>     return DIV.xml(newform)
>   File "/opt/web-apps/web2py/gluon/html.py", line 780, in xml
>     (fa, co) = self._xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 771, in _xml
>     self.components])
>   File "/opt/web-apps/web2py/gluon/html.py", line 118, in xmlescape
>     data = str(data)
>   File "/opt/web-apps/web2py/gluon/html.py", line 797, in __str__
>     return self.xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 780, in xml
>     (fa, co) = self._xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 771, in _xml
>     self.components])
>   File "/opt/web-apps/web2py/gluon/html.py", line 118, in xmlescape
>     data = str(data)
>   File "/opt/web-apps/web2py/gluon/html.py", line 797, in __str__
>     return self.xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 780, in xml
>     (fa, co) = self._xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 771, in _xml
>     self.components])
>   File "/opt/web-apps/web2py/gluon/html.py", line 118, in xmlescape
>     data = str(data)
>   File "/opt/web-apps/web2py/gluon/html.py", line 797, in __str__
>     return self.xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 780, in xml
>     (fa, co) = self._xml()
>   File "/opt/web-apps/web2py/gluon/html.py", line 771, in _xml
>     self.components])
>   File "/opt/web-apps/web2py/gluon/html.py", line 118, in xmlescape
>     data = str(data)
>   File "/opt/web-apps/web2py/gluon/html.py", line 797, in __str__
>     return self.xml()
>   File "/opt/web-apps/web2py/gluon/tools.py", line 666, in xml
>     SCRIPT("var RecaptchaOptions = {%s};" % self.options),
> AttributeError: 'Recaptcha' object has no attribute 'options'

Reply via email to