Sfoglia il codice sorgente

Fix image path construction

Daniel Sheppard 6 mesi fa
parent
commit
8fd8493d11
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      netbox/extras/api/views.py

+ 1 - 1
netbox/extras/api/views.py

@@ -211,7 +211,7 @@ class ImageAttachmentViewSet(NetBoxModelViewSet):
     def download(self, request, pk, *args, **kwargs):
         obj = get_object_or_404(self.queryset, pk=pk)
         # Render and return the elevation as an SVG drawing with the correct content type
-        return serve(request, obj.image.path, document_root=settings.MEDIA_ROOT)
+        return serve(request, obj.image.name, document_root=settings.MEDIA_ROOT)
 
 
 #