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:
Rebecca Law
2016-01-07 17:13:49 +00:00
parent 8057a138a8
commit a860f713d2
17 changed files with 87 additions and 156 deletions

View File

@@ -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',