Device-Type-Library-Import icon indicating copy to clipboard operation
Device-Type-Library-Import copied to clipboard

Uploading of front/rear images for device types fails

Open jbemmel opened this issue 2 years ago • 4 comments

The front_image and rear_image attributes require special handling for uploading images into Django. Since the script doesn't use multipart/form data, the import of any device type that specifies these attributes fails with

{"front_image":["The submitted data was not a file. Check the encoding type on the form."],"rear_image":["The submitted data was not a file. Check the encoding type on the form."]}

jbemmel avatar Mar 17 '23 14:03 jbemmel

Hello @jbemmel, as mentioned in the PR, v2.0.0 was released today. Thus, you will need to reevaluate how your PR is written and what files have been modified. I would be glad to assist if needed.

danner26 avatar Mar 24 '23 19:03 danner26

Please also refer to this PR in the devicetype-library as well as this issue thread.

In the coming days I will also be working on a new release for this script to accommodate these changes. Feel free to pitch in if you would like

danner26 avatar Mar 24 '23 21:03 danner26

Working on a draft here: https://github.com/jbemmel/Device-Type-Library-Import/tree/fix_image_upload_v2

Need to move the images to the new location, will update after you push that

jbemmel avatar Mar 25 '23 00:03 jbemmel

Awesome, once the PR is fixed I'll merge the images for you

danner26 avatar Mar 25 '23 00:03 danner26