[ZPT] CVS: Zope/lib/python/Products/PageTemplates - ZopePageTemplate.py:1.33
Casey Duncan
casey@zope.com
Fri, 12 Apr 2002 11:37:44 -0400
Update of /cvs-repository/Zope/lib/python/Products/PageTemplates
In directory cvs.zope.org:/tmp/cvs-serv9270/lib/python/Products/PageTemplates
Modified Files:
ZopePageTemplate.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/Products/PageTemplates/ZopePageTemplate.py 1.32 => 1.33 ===
if SUPPORTS_WEBDAV_LOCKS and self.wl_isLocked():
raise ResourceLockedError, "File is locked via WebDAV"
- if type(file) is not type(''): file = file.read()
+
+ if type(file) is not type(''):
+ if not file: raise ValueError, 'File not specified'
+ file = file.read()
+
self.write(file)
message = 'Saved changes.'
return self.pt_editForm(manage_tabs_message=message)