mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
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:
@@ -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()])
|
||||
|
||||
Reference in New Issue
Block a user