Add confirmation of password for important changes

This commit adds an extra page or field for confirming your current password
when making important changes

Name                 | Email address     | Mobile number     | Password
---------------------|-------------------|-------------------|------------
No password required | As second page    | As second page    | On same page as new password
This commit is contained in:
Chris Hill-Scott
2016-01-12 11:25:46 +00:00
parent df79dc69f6
commit c94ac4266c
6 changed files with 129 additions and 10 deletions

View File

@@ -31,8 +31,8 @@ def mobile_number():
Regexp(regex=mobile_number_regex, message='Enter a +44 mobile number')])
def password():
return PasswordField('Create a password',
def password(label='Create a password'):
return PasswordField(label,
validators=[DataRequired(message='Password can not be empty'),
Length(10, 255, message='Password must be at least 10 characters'),
Blacklist(message='That password is blacklisted, too common')])
@@ -152,6 +152,11 @@ class NewPasswordForm(Form):
new_password = password()
class ChangePasswordForm(Form):
old_password = password('Current password')
new_password = password('New password')
class CsvUploadForm(Form):
file = FileField('File to upload', validators=[DataRequired(
message='Please pick a file'), CsvFileValidator()])