Fix FTP upload when uploading only a single file and its name contains a comma. util.listify assumes that a string with commas should be split into a list, so don't use listify for this value. Thanks Ilya Chorny.

This commit is contained in:
Nate Coraor
2011-08-22 14:47:10 -04:00
parent aec47aa2a9
commit cdd29d1781
+5 -1
View File
@@ -454,7 +454,11 @@ class FTPFileToolParameter( ToolParameter ):
user_ftp_dir = os.path.join( trans.app.config.ftp_upload_dir, trans.user.email )
return form_builder.FTPFileField( self.name, user_ftp_dir, trans.app.config.ftp_upload_site, value = value )
def from_html( self, value, trans=None, other_values={} ):
return util.listify( value )
try:
assert type( value ) is list
except:
value = [ value ]
return value
def to_string( self, value, app ):
if value in [ None, '' ]:
return None