diff --git a/docs/release-notes/version-2.9.md b/docs/release-notes/version-2.9.md index eeab02259..b08a35aca 100644 --- a/docs/release-notes/version-2.9.md +++ b/docs/release-notes/version-2.9.md @@ -14,6 +14,7 @@ * [#5407](https://github.com/netbox-community/netbox/issues/5407) - Add direct link to secret on secrets list * [#5408](https://github.com/netbox-community/netbox/issues/5408) - Fix updating secrets without setting new plaintext * [#5410](https://github.com/netbox-community/netbox/issues/5410) - Restore tags field on cable connection forms +* [#5433](https://github.com/netbox-community/netbox/issues/5433) - Exclude SVG files from front/rear image upload for device types (currently unsupported) * [#5436](https://github.com/netbox-community/netbox/issues/5436) - Show assigned IP addresses in interfaces list --- diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index aa7537c7b..e56605250 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -922,7 +922,14 @@ class DeviceTypeForm(BootstrapMixin, CustomFieldModelForm): 'front_image', 'rear_image', 'comments', 'tags', ] widgets = { - 'subdevice_role': StaticSelect2() + 'subdevice_role': StaticSelect2(), + # Exclude SVG images (unsupported by PIL) + 'front_image': forms.FileInput(attrs={ + 'accept': 'image/bmp,image/gif,image/jpeg,image/png,image/tiff' + }), + 'rear_image': forms.FileInput(attrs={ + 'accept': 'image/bmp,image/gif,image/jpeg,image/png,image/tiff' + }) }