1
0
forked from s434650/CatOrNot
CatOrNot/venv/lib/python3.6/site-packages/flask_wtf/recaptcha/fields.py

18 lines
453 B
Python
Raw Normal View History

2018-12-11 00:32:28 +01:00
from wtforms.fields import Field
from . import widgets
from .validators import Recaptcha
__all__ = ["RecaptchaField"]
class RecaptchaField(Field):
widget = widgets.RecaptchaWidget()
# error message if recaptcha validation fails
recaptcha_error = None
def __init__(self, label='', validators=None, **kwargs):
validators = validators or [Recaptcha()]
super(RecaptchaField, self).__init__(label, validators, **kwargs)