netbox-community / Device-Type-Library-Import

This library is intended to assist with importing device and module types into NetBox from the NetBox Community DeviceType-Library
https://github.com/netbox-community/devicetype-library
MIT License
248 stars 75 forks source link

Uploading of front/rear images for device types fails #84

Open jbemmel opened 1 year ago

jbemmel commented 1 year ago

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."]}
danner26 commented 1 year ago

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 commented 1 year ago

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

jbemmel commented 1 year ago

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

danner26 commented 1 year ago

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