[PR #17787] [CLOSED] Fixes: #17740 - Add webp to the list of acceptable extensions for handling filenames in image_upload #15197

Closed
opened 2025-12-30 00:20:33 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17787
Author: @bctiemann
Created: 10/16/2024
Status: Closed

Base: developHead: 17740-add-webp-to-image_upload


📝 Commits (10+)

📊 Changes

91 files changed (+495 additions, -510 deletions)

View changed files

📝 docs/configuration/miscellaneous.md (+0 -8)
📝 docs/models/circuits/circuit.md (+6 -0)
📝 docs/models/dcim/inventoryitem.md (+4 -0)
📝 docs/models/dcim/poweroutlet.md (+4 -0)
📝 docs/models/extras/branch.md (+3 -0)
📝 docs/models/extras/stagedchange.md (+3 -0)
📝 docs/plugins/development/staged-changes.md (+2 -2)
📝 netbox/circuits/api/serializers_/circuits.py (+3 -1)
📝 netbox/circuits/filtersets.py (+1 -1)
📝 netbox/circuits/forms/bulk_edit.py (+13 -0)
📝 netbox/circuits/forms/bulk_import.py (+8 -1)
📝 netbox/circuits/forms/filtersets.py (+12 -1)
📝 netbox/circuits/forms/model_forms.py (+13 -3)
netbox/circuits/migrations/0045_circuit_distance.py (+28 -0)
📝 netbox/circuits/models/circuits.py (+2 -10)
📝 netbox/circuits/models/providers.py (+0 -10)
📝 netbox/circuits/tables/circuits.py (+1 -0)
📝 netbox/circuits/tests/test_filtersets.py (+12 -3)
📝 netbox/core/models/data.py (+0 -3)
📝 netbox/dcim/api/serializers_/device_components.py (+3 -2)

...and 71 more files

📄 Description

Fixes: #17740

This ensures that image files with a .webp extension will be handled the same way as png, jpg, jpeg, etc. in that the appropriate extension will be appended to the saved file in media.

This addresses a knock-on issue raised in #17740 that a filename with multiple dots will have the rightmost dotted segment treated as the "extension", resulting in a (seemingly) unopenable file after download from NetBox.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/17787 **Author:** [@bctiemann](https://github.com/bctiemann) **Created:** 10/16/2024 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `17740-add-webp-to-image_upload` --- ### 📝 Commits (10+) - [`c60a0f4`](https://github.com/netbox-community/netbox/commit/c60a0f4f56f0cf5f259eb0b4520b84e43741e876) 16136 remove Django Admin (#17619) - [`8cd0a32`](https://github.com/netbox-community/netbox/commit/8cd0a3215ca64ef57cfe550df23c73024feb9334) 16783 Add status field to InventoryItem (#17627) - [`2c68aca`](https://github.com/netbox-community/netbox/commit/2c68aca344e64a2d6dbd8491b3c2eea759776b4c) 17195 Add color to PowerOutlet (#17623) - [`1969f0d`](https://github.com/netbox-community/netbox/commit/1969f0dc71f7c5fe75d0db54bd47b828b120fddd) fix migrations - [`3f469b0`](https://github.com/netbox-community/netbox/commit/3f469b0b0a690dfc9b2a03f95d8cea5ea846e005) 17476 Upgrade to Django 5.1 (#17620) - [`ed1327e`](https://github.com/netbox-community/netbox/commit/ed1327eeb729e0cf4805698aef74df64cf7534de) 16546 define get_absolute_url method in NetBoxModel (#17693) - [`bc597c3`](https://github.com/netbox-community/netbox/commit/bc597c3c5d038770f152d3c343b844e3f3996d92) Closes #17472: Deprecate the staged changes API - [`6568785`](https://github.com/netbox-community/netbox/commit/65687851fe093caa6382b7e9fed522b4e5316589) 16547 Add distance to Circuit (#17629) - [`256b5dc`](https://github.com/netbox-community/netbox/commit/256b5dc676c78942924bab5b071423e9ea58da77) Merge branch 'develop' into feature - [`b99c356`](https://github.com/netbox-community/netbox/commit/b99c356d1d3bab9fd6c28371f26049f961bde52b) Fix migrations conflict ### 📊 Changes **91 files changed** (+495 additions, -510 deletions) <details> <summary>View changed files</summary> 📝 `docs/configuration/miscellaneous.md` (+0 -8) 📝 `docs/models/circuits/circuit.md` (+6 -0) 📝 `docs/models/dcim/inventoryitem.md` (+4 -0) 📝 `docs/models/dcim/poweroutlet.md` (+4 -0) 📝 `docs/models/extras/branch.md` (+3 -0) 📝 `docs/models/extras/stagedchange.md` (+3 -0) 📝 `docs/plugins/development/staged-changes.md` (+2 -2) 📝 `netbox/circuits/api/serializers_/circuits.py` (+3 -1) 📝 `netbox/circuits/filtersets.py` (+1 -1) 📝 `netbox/circuits/forms/bulk_edit.py` (+13 -0) 📝 `netbox/circuits/forms/bulk_import.py` (+8 -1) 📝 `netbox/circuits/forms/filtersets.py` (+12 -1) 📝 `netbox/circuits/forms/model_forms.py` (+13 -3) ➕ `netbox/circuits/migrations/0045_circuit_distance.py` (+28 -0) 📝 `netbox/circuits/models/circuits.py` (+2 -10) 📝 `netbox/circuits/models/providers.py` (+0 -10) 📝 `netbox/circuits/tables/circuits.py` (+1 -0) 📝 `netbox/circuits/tests/test_filtersets.py` (+12 -3) 📝 `netbox/core/models/data.py` (+0 -3) 📝 `netbox/dcim/api/serializers_/device_components.py` (+3 -2) _...and 71 more files_ </details> ### 📄 Description ### Fixes: #17740 This ensures that image files with a `.webp` extension will be handled the same way as `png`, `jpg`, `jpeg`, etc. in that the appropriate extension will be appended to the saved file in `media`. This addresses a knock-on issue raised in #17740 that a filename with multiple dots will have the rightmost dotted segment treated as the "extension", resulting in a (seemingly) unopenable file after download from NetBox. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:20:33 +01:00
adam closed this issue 2025-12-30 00:20:33 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15197