From: Stefan H. H. <sh...@us...> - 2004-02-29 21:06:41
|
Update of /cvsroot/plone/CMFPlone/skins/plone_form_scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23210/skins/plone_form_scripts Modified Files: Tag: Plone-2_0-branch image_edit.cpy validate_image_edit.vpy Log Message: Fixed over Seb's earlier fix for http://plone.org/collector/2246 (Sorry, Seb ;-) Added unit tests for image_edit and file_edit Index: image_edit.cpy =================================================================== RCS file: /cvsroot/plone/CMFPlone/skins/plone_form_scripts/image_edit.cpy,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -d -r1.1.2.5 -r1.1.2.6 --- image_edit.cpy 29 Feb 2004 18:55:52 -0000 1.1.2.5 +++ image_edit.cpy 29 Feb 2004 20:56:11 -0000 1.1.2.6 @@ -20,10 +20,7 @@ id = filename[max( string.rfind(filename, '/') , string.rfind(filename, '\\') , string.rfind(filename, ':') )+1:] - -if not file and context.get_size(): - file = context.data -else: +if file and hasattr(file, 'seek'): file.seek(0) # if there is no id specified, keep the current one Index: validate_image_edit.vpy =================================================================== RCS file: /cvsroot/plone/CMFPlone/skins/plone_form_scripts/validate_image_edit.vpy,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -d -r1.1.2.3 -r1.1.2.4 --- validate_image_edit.vpy 29 Feb 2004 18:57:03 -0000 1.1.2.3 +++ validate_image_edit.vpy 29 Feb 2004 20:56:11 -0000 1.1.2.4 @@ -10,10 +10,10 @@ ## size = 0 -if not file: +if file is None: filename=None else: - filename=getattr(file, 'filename') + filename=getattr(file, 'filename', None) if hasattr(context, 'get_size'): # make sure things work with portal_factory size=context.get_size() |