Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String Validator from the pagure/validators.py:
- class StringValidator(object):
- """Validates input to be a string"""
- def __init__(self, message="This field needs to be a string"):
- self._message = message
- def __call__(self, form, stringfield):
- if type(stringfield.data) != six.text_type:
- raise validators.ValidationError(
- "{0} Found {1}".format(self._message, stringfield.data)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement