def validate_email_address(form, field): if not EMAIL_ADDRESS_REGEX.match(field.data): raise ValidationError("Invalid email address format")
def validate_combined_email_address(form, field): if not EMAIL_ADDRESS_REGEX.match("%s@%s" % (form.data['username'], form.data['domain'])): raise ValidationError("Invalid email address format")