Commits

anti_social committed a66cf91

Change Required validator, now it can correctly work with FileField.

Comments (0)

Files changed (1)

wtforms/validators.py

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