jasonyates / netbox-documents

Plugin to manage site, circuit and device diagrams and documents in Netbox
Apache License 2.0
131 stars 20 forks source link

Missing filename extension after saving pptx document #64

Open ggaspa opened 3 months ago

ggaspa commented 3 months ago

After saving a pptx file, I noticed that no extension was present on downloaded file.

On file utils.py - from row 26 to 31

# 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', 'pdf', 'txt', 'doc', 'docx', 'xls', 'xlsx', 'xlsm', 'tif', 'tiff']:
        filename = '.'.join([instance.name, extension])
    elif instance.name:
        filename = instance.name

I see that only specific list of extension is supported. Why?