Skip to content

Commit

Permalink
Merge pull request #1315 from s11-charendt/develop
Browse files Browse the repository at this point in the history
Preserve fileextension, regardless of upper or lower case on imageupload
  • Loading branch information
jeremystretch authored Jul 5, 2017
2 parents 1d4a416 + e081070 commit 5233463
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netbox/extras/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5233463

Please sign in to comment.