-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
forms.py
37 lines (29 loc) · 1 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# coding=utf-8
"""
This file contains all the changes to forms required for this application
"""
from flask_babelex import gettext as _
from flask_security.forms import ForgotPasswordForm, RegisterForm, ResetPasswordForm, SendConfirmationForm, StringField
from flask_wtf import RecaptchaField
from wtforms.validators import DataRequired
class ExtendedRegisterForm(RegisterForm):
"""
Adds first name and captcha to the registration form
"""
first_name = StringField(_("First name"), [DataRequired()])
recaptcha = RecaptchaField("Captcha")
class ExtendedResetForm(ResetPasswordForm):
"""
Adds captcha to the password reset form
"""
recaptcha = RecaptchaField("Captcha")
class ExtendedConfirmationForm(SendConfirmationForm):
"""
Adds captcha to the confirm account form
"""
recaptcha = RecaptchaField("Captcha")
class ExtendedForgotPasswordForm(ForgotPasswordForm):
"""
Adds captcha to forgot password column
"""
recaptcha = RecaptchaField("Captcha")