mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
Added check for password on service change page, work in progress.
This commit is contained in:
@@ -186,8 +186,17 @@ class ServiceNameForm(Form):
|
||||
|
||||
|
||||
class ConfirmPasswordForm(Form):
|
||||
|
||||
def __init__(self, validate_password_func, *args, **kwargs):
|
||||
self.validate_password_func = validate_password_func
|
||||
super(ConfirmPasswordForm, self).__init__(*args, **kwargs)
|
||||
|
||||
password = PasswordField(u'Enter password')
|
||||
|
||||
def validate_password(self, field):
|
||||
if not self.validate_password_func(field.data):
|
||||
raise ValidationError('Invalid password')
|
||||
|
||||
|
||||
class TemplateForm(Form):
|
||||
name = StringField(
|
||||
|
||||
Reference in New Issue
Block a user