-
Notifications
You must be signed in to change notification settings - Fork 174
exception should be raised for badly-formed calls #300
Copy link
Copy link
Closed
Labels
enhancementIssue/PR: A new featureIssue/PR: A new featureoutdatedIssue/PR: Open for more than 3 monthsIssue/PR: Open for more than 3 months
Description
With the recent change to email validator signature, this previously-correct usage now fails:
domain_whitelist = ['microsoft.com']
email('bill.gates@microsoft.com', domain_whitelist)
ValidationFailure(func=email, args={'reason': 'email() takes 1 positional argument but 2 were given', 'value': 'bill.gates@microsoft.com'})
But that's not a validation issue - it's a programming issue, and one that becomes difficult to track down when the form validation library is checking True/False and reporting an invalid email address.
When the error is not because of the input being validated, but rather due to the way the validator is called, we need to have exceptions raised.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementIssue/PR: A new featureIssue/PR: A new featureoutdatedIssue/PR: Open for more than 3 monthsIssue/PR: Open for more than 3 months