Skip to content

Conversation

@rnt
Copy link

@rnt rnt commented Mar 10, 2022

This pull request allows you to use forms, without commenting on the recaptcha field when you are offline.

It's #214 but more than 6 years later. ;)

  • fixes #

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code.
  • Add an entry in docs/changes.rst summarizing the change and linking to the issue. Add .. versionchanged:: entries in any relevant code docs.

@azmeuk
Copy link
Member

azmeuk commented Jan 13, 2023

Thank you for your contribution. This looks OK to me. However I am wondering if RECAPTCHA_ENABLED with a default to True would not be better, to match with the other configuration vars (WTF_CSRF_ENABLED and WTF_I18N_ENABLED).

What do you think?

@PanderMusubi
Copy link

Perhaps as an alternative or for in the documentation, simply use:

if not app.debug:
    app.config['RECAPTCHA_PUBLIC_KEY'] = ...
    app.config['RECAPTCHA_PRIVATE_KEY'] = ...
    ...


    ...
    if not app.debug:
        recaptcha = RecaptchaField()
    submit = SubmitField('Submit')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants