mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-16 20:49:00 -04:00
Implementation of the new_password endpoint.
Found a way to create the token that does not need to persist it to the database. This requires proper error messages, written by people who speak menglis good.
This commit is contained in:
@@ -24,7 +24,6 @@ verify_code = '^\d{5}$'
|
||||
|
||||
|
||||
class RegisterUserForm(Form):
|
||||
|
||||
def __init__(self, existing_email_addresses, existing_mobile_numbers, *args, **kwargs):
|
||||
self.existing_emails = existing_email_addresses
|
||||
self.existing_mobiles = existing_mobile_numbers
|
||||
@@ -125,10 +124,6 @@ class AddServiceForm(Form):
|
||||
|
||||
|
||||
class ForgotPasswordForm(Form):
|
||||
def __init__(self, email_addresses, *args, **kargs):
|
||||
self.email_addresses = email_addresses
|
||||
super(ForgotPasswordForm, self).__init__(*args, **kargs)
|
||||
|
||||
email_address = StringField('Email address',
|
||||
validators=[Length(min=5, max=255),
|
||||
DataRequired(message='Email cannot be empty'),
|
||||
@@ -136,10 +131,6 @@ class ForgotPasswordForm(Form):
|
||||
Regexp(regex=gov_uk_email, message='Please enter a gov.uk email address')
|
||||
])
|
||||
|
||||
def validate_email_address(self, a):
|
||||
if self.email_address.data not in self.email_addresses:
|
||||
raise ValidationError('Please enter the email address that you registered with')
|
||||
|
||||
|
||||
class NewPasswordForm(Form):
|
||||
new_password = StringField('Create a password',
|
||||
|
||||
Reference in New Issue
Block a user