mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
All tests passing and merged with master.
This commit is contained in:
@@ -105,8 +105,8 @@ class LoginForm(Form):
|
||||
|
||||
|
||||
class RegisterUserForm(Form):
|
||||
def __init__(self, existing_email_addresses, *args, **kwargs):
|
||||
self.existing_emails = existing_email_addresses
|
||||
def __init__(self, unique_email_func, *args, **kwargs):
|
||||
self.unique_email_func = unique_email_func
|
||||
super(RegisterUserForm, self).__init__(*args, **kwargs)
|
||||
|
||||
name = StringField('Full name',
|
||||
@@ -117,7 +117,7 @@ class RegisterUserForm(Form):
|
||||
|
||||
def validate_email_address(self, field):
|
||||
# Validate email address is unique.
|
||||
if self.existing_emails(field.data):
|
||||
if not self.unique_email_func(field.data):
|
||||
raise ValidationError('Email address already exists')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user