瀏覽代碼

Fix image path construction

Daniel Sheppard 7 月之前
父節點
當前提交
8fd8493d11
共有 1 個文件被更改,包括 1 次插入1 次删除
  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):
     def download(self, request, pk, *args, **kwargs):
         obj = get_object_or_404(self.queryset, pk=pk)
         obj = get_object_or_404(self.queryset, pk=pk)
         # Render and return the elevation as an SVG drawing with the correct content type
         # 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)
 
 
 
 
 #
 #