소스 검색

Merge pull request #1315 from s11-charendt/develop

Preserve fileextension, regardless of upper or lower case on imageupload
Jeremy Stretch 8 년 전
부모
커밋
5233463f0b
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      netbox/extras/models.py

+ 1 - 1
netbox/extras/models.py

@@ -387,7 +387,7 @@ def image_upload(instance, filename):
     path = 'image-attachments/'
 
     # Rename the file to the provided name, if any. Attempt to preserve the file extension.
-    extension = filename.rsplit('.')[-1]
+    extension = filename.rsplit('.')[-1].lower()
     if instance.name and extension in ['bmp', 'gif', 'jpeg', 'jpg', 'png']:
         filename = '.'.join([instance.name, extension])
     elif instance.name: