Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with RecaptchaField and Flask-babel #70

Closed
giocalitri opened this issue May 10, 2013 · 1 comment
Closed

Bug with RecaptchaField and Flask-babel #70

giocalitri opened this issue May 10, 2013 · 1 comment

Comments

@giocalitri
Copy link

If Flask-babel is installed but not used and not configured in the app, when a RecaptchaField is used in the template, you get an exception like the following:

  File "/Users/dimilia/Sites/wrk/adslabs-beer/adsabs/modules/feedback/templates/feedback_macro.html", line 47, in template
    {{ form.recaptcha() }}
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/wtforms/fields/core.py", line 140, in __call__
    return self.widget(self, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/flask_wtf/recaptcha/widgets.py", line 68, in __call__
    'visual_challenge':    _('Get a visual challenge'),
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/flaskext/babel.py", line 456, in gettext
    t = get_translations()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/flaskext/babel.py", line 194, in get_translations
    translations = support.Translations.load(dirname, [get_locale()])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/flaskext/babel.py", line 209, in get_locale
    babel = ctx.app.extensions['babel']
KeyError: 'babel'

My installation is the following:

pip-2.6 freeze | grep -i flask
Flask==0.9
Flask-Babel==0.8
Flask-Cache==0.6.0
Flask-DebugToolbar==0.8.0
Flask-Login==0.1.3
Flask-Mail==0.7.6
Flask-MongoAlchemy==0.5.4
Flask-Pushrod==0.1.2
Flask-SQLAlchemy==0.16
Flask-Script==0.5.3
Flask-Testing==0.4
Flask-Uploads==0.1.3
Flask-WTF==0.8.3

Thanks!

lepture added a commit that referenced this issue Jul 4, 2013
@lepture
Copy link
Contributor

lepture commented Aug 7, 2013

I believe this is fixed, will roll out version 0.9.0

@lepture lepture closed this as completed Aug 7, 2013
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants