-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Description
Hi, while challenging our API with random input we noticed that the Email validator wasn't failing with a ValidationError when we give it the wrong input:
em = fe.validators.Email()
em.to_python(45)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-19-4dfaedfd72a0> in <module>()
----> 1 em.to_python(45)
~/.pyenv/versions/3.6.5/envs/cmp/lib/python3.6/site-packages/formencode/api.py in to_python(self, value, state)
--> 475 value = tp(value, state)
~/.pyenv/versions/3.6.5/envs/cmp/lib/python3.6/site-packages/formencode/validators.py in _convert_to_python(self, value, state)
-> 1390 return value.strip()
AttributeError: 'int' object has no attribute 'strip'
Before starting to work on this, I was wondering if there is any reason that validators.Email inherit from FancyValidator and not from validators.String? In fact, changing this would fix this bug
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels