[Zope-Checkins] CVS: Zope/lib/python/ZPublisher - HTTPRequest.py:1.66

Casey Duncan casey@zope.com
Fri, 12 Apr 2002 11:37:14 -0400


Update of /cvs-repository/Zope/lib/python/ZPublisher
In directory cvs.zope.org:/tmp/cvs-serv9270/lib/python/ZPublisher

Modified Files:
	HTTPRequest.py 
Log Message:
FileUpload objects now eval false if filename is empty.
Upload buttons on DTML, Py Scripts, Files, Images and PTs raise an error
if the file is not specified instead of clearing the source (Bug #144)


=== Zope/lib/python/ZPublisher/HTTPRequest.py 1.65 => 1.66 ===
         try:    self.headers.__allow_access_to_unprotected_subobjects__ = 1
         except: pass
+        
+    def __nonzero__(self):
+        """FileUpload objects are considered false if their 
+           filename is empty.
+        """
+        return not not self.filename
 
 
 parse_cookie_lock=allocate_lock()