I have a custom validator called `FlexPassword`
class FlexPassword(formencode.FancyValidator):
def _to_python(self, value, state):
raise formencode.Invalid('validator ran', value, state)
Here's my schema:
password =
formencode.All(formencode.validators.PlainText(not_empty=True),
FlexPassword())
As expected, when no characters are entered, the PlainText error is
raised. Also as expected, when a single character is entered, the
FlexPassword error is raised.
But that's not the schema I want to use. This is:
password = formencode.All(FlexPassword())
Contrary to expectation, when no characters are entered, the
FlexPassword error is not raised. Huh? As expected, when a single
character is entered, the FlexPassword error is raised.
The way I've got it wired up, the form should always fail validation,
but with a blank password, it passes. Any insights for me? Thanks.
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.