diff --git a/apiserver/plane/api/urls.py b/apiserver/plane/api/urls.py index bf713a927..69df81c9e 100644 --- a/apiserver/plane/api/urls.py +++ b/apiserver/plane/api/urls.py @@ -814,7 +814,7 @@ urlpatterns = [ name="user-file-assets", ), path( - "users/file-assets/user-profile//", + "users/file-assets//", UserAssetsEndpoint.as_view(), name="user-file-assets", ), diff --git a/apiserver/plane/api/views/asset.py b/apiserver/plane/api/views/asset.py index be464c2d4..abdee4812 100644 --- a/apiserver/plane/api/views/asset.py +++ b/apiserver/plane/api/views/asset.py @@ -91,8 +91,6 @@ class UserAssetsEndpoint(BaseAPIView): def delete(self, request, asset_key): try: - asset_key = "user-profile" + "/" + asset_key - print(asset_key) file_asset = FileAsset.objects.get(asset=asset_key, created_by=request.user) # Delete the file from storage file_asset.asset.delete(save=False) diff --git a/apiserver/plane/db/models/asset.py b/apiserver/plane/db/models/asset.py index eba8beefc..acbb9428f 100644 --- a/apiserver/plane/db/models/asset.py +++ b/apiserver/plane/db/models/asset.py @@ -12,7 +12,7 @@ from . import BaseModel def get_upload_path(instance, filename): if instance.workspace_id is not None: return f"{instance.workspace.id}/{uuid4().hex}-{filename}" - return f"user-profile/{uuid4().hex}-{filename}" + return f"user-{uuid4().hex}-{filename}" def file_size(value):