Commits

metalness committed c4aa3d8 Draft

fixed issue #116: when validate a Required field, use "if field.data is None" instead of "if not field.data"

Comments (0)

Files changed (1)

wtforms/validators.py

         self.message = message
 
     def __call__(self, form, field):
-        if not field.data or isinstance(field.data, string_types) and not field.data.strip():
+        if field.data is None or isinstance(field.data, string_types) and not field.data.strip():
             if self.message is None:
                 self.message = field.gettext('This field is required.')