forked from github/plane
fix: changed workspace id to slug
This commit is contained in:
parent
77b7d43042
commit
0fe3dfddc6
@ -20,7 +20,7 @@ urlpatterns = [
|
|||||||
name="file-assets",
|
name="file-assets",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"<uuid:workspace_id>/<str:asset_key>/",
|
"<str:slug>/<str:asset_key>/",
|
||||||
AssetsEndpoint.as_view(),
|
AssetsEndpoint.as_view(),
|
||||||
name="file-assets",
|
name="file-assets",
|
||||||
),
|
),
|
||||||
|
@ -80,10 +80,10 @@ class AssetsEndpoint(BaseAPIView):
|
|||||||
permission_classes = [WorkspaceEntityPermission]
|
permission_classes = [WorkspaceEntityPermission]
|
||||||
parser_classes = (MultiPartParser, FormParser)
|
parser_classes = (MultiPartParser, FormParser)
|
||||||
|
|
||||||
def get(self, request, workspace_id, asset_key):
|
def get(self, request, slug, asset_key):
|
||||||
|
workspace = Workspace.objects.get(slug=slug)
|
||||||
asset_key = str(workspace_id) + "/" + asset_key
|
asset_key = str(workspace.id) + "/" + asset_key
|
||||||
file_asset = FileAsset.objects.get(workspace_id=workspace_id,asset=asset_key)
|
file_asset = FileAsset.objects.get(workspace_id=workspace.id, asset=asset_key)
|
||||||
response = StreamingHttpResponse(file_asset.asset.open(mode='rb'), content_type='application/octet-stream')
|
response = StreamingHttpResponse(file_asset.asset.open(mode='rb'), content_type='application/octet-stream')
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user