Author: ltucker
Date: 2008-10-21 11:21:18 -0600 (Tue, 21 Oct 2008)
New Revision: 3630
Modified:
FormEncode/trunk/docs/news.txt
FormEncode/trunk/formencode/validators.py
Log:
Fix is_empty() method in FieldStorageUploadConverter; was returning opposite of
intent.
Modified: FormEncode/trunk/docs/news.txt
===================================================================
--- FormEncode/trunk/docs/news.txt 2008-10-19 00:40:31 UTC (rev 3629)
+++ FormEncode/trunk/docs/news.txt 2008-10-21 17:21:18 UTC (rev 3630)
@@ -6,6 +6,10 @@
svn trunk
---------
+* Fixed the ``is_empty()`` method in
+ :class:`formencode.validators.FieldStorageUploadConverter`;
+ previously it returned the opposite of the intended result.
+
* Added a parameter to ``htmlfill.render()``: ``prefix_error``. If
this parameter is true (the default) then errors automatically go
before the input field; if false then they go after the input field.
Modified: FormEncode/trunk/formencode/validators.py
===================================================================
--- FormEncode/trunk/formencode/validators.py 2008-10-19 00:40:31 UTC (rev
3629)
+++ FormEncode/trunk/formencode/validators.py 2008-10-21 17:21:18 UTC (rev
3630)
@@ -1762,7 +1762,7 @@
def is_empty(self, value):
if isinstance(value, cgi.FieldStorage):
- return bool(getattr(value, 'filename', None))
+ return not bool(getattr(value, 'filename', None))
return FancyValidator.is_empty(self, value)
class FileUploadKeeper(FancyValidator):
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
FormEncode-CVS mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/formencode-cvs