From 664526de546e8cf0d861bc17246379fcc084ef92 Mon Sep 17 00:00:00 2001 From: Brian Tiemann Date: Wed, 16 Oct 2024 15:06:21 -0400 Subject: [PATCH] Add webp to the list of acceptable extensions for handling filenames in image_upload --- netbox/extras/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox/extras/utils.py b/netbox/extras/utils.py index 28d2e13f07b..efe7ada5bbc 100644 --- a/netbox/extras/utils.py +++ b/netbox/extras/utils.py @@ -33,7 +33,7 @@ def image_upload(instance, filename): # Rename the file to the provided name, if any. Attempt to preserve the file extension. extension = filename.rsplit('.')[-1].lower() - if instance.name and extension in ['bmp', 'gif', 'jpeg', 'jpg', 'png']: + if instance.name and extension in ['bmp', 'gif', 'jpeg', 'jpg', 'png', 'webp']: filename = '.'.join([instance.name, extension]) elif instance.name: filename = instance.name