瀏覽代碼

Add webp to the list of acceptable extensions for handling filenames in image_upload

Brian Tiemann 1 年之前
父節點
當前提交
81108e405f
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      netbox/extras/utils.py

+ 1 - 1
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