Chive / django-multiupload

Dead simple drop-in multi file upload field for Django forms using HTML5's multiple attribute.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

value_from_datadict does not work for testing purpose

garaud opened this issue · comments

Hi,

I think MultiFileInput.value_from_datadict does not return the correct type when getlistis not a method of the filesparameter.

When I test my form where there is a MultiFileField field, I use SimpleUploadedFileas input data files and I got an error message such as No file was submitted. Check the encoding type on the form. even if there is some content in the files param.

Fix this replacing:

return [files.get(name)]

by

return files.get(name)

in value_from_datadict method. files[name] is already a list of Files.

Cheer,
Damien G.

Thanks for reporting this Damien! I'll look into this as soon as I am going to be back from my military service in about a month. Cheers

Just checking in for an update - I'd love to be able to test multi file uploads...

Agreed. Sorry about the delay, thanks to the both of you @garaud and @prikhi!