chore: issue attachment deletion (#5903)

This commit is contained in:
Bavisetti Narayan 2024-10-23 20:11:01 +05:30 committed by GitHub
parent 25a410719b
commit 5afa686a21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View file

@ -209,7 +209,7 @@ class UserAssetsV2Endpoint(BaseAPIView):
# update the attributes # update the attributes
asset.attributes = request.data.get("attributes", asset.attributes) asset.attributes = request.data.get("attributes", asset.attributes)
# save the asset # save the asset
asset.save() asset.save(created_by=request.user)
return Response(status=status.HTTP_204_NO_CONTENT) return Response(status=status.HTTP_204_NO_CONTENT)
def delete(self, request, asset_id): def delete(self, request, asset_id):
@ -459,7 +459,7 @@ class WorkspaceFileAssetEndpoint(BaseAPIView):
# update the attributes # update the attributes
asset.attributes = request.data.get("attributes", asset.attributes) asset.attributes = request.data.get("attributes", asset.attributes)
# save the asset # save the asset
asset.save() asset.save(created_by=request.user)
return Response(status=status.HTTP_204_NO_CONTENT) return Response(status=status.HTTP_204_NO_CONTENT)
def delete(self, request, slug, asset_id): def delete(self, request, slug, asset_id):
@ -690,7 +690,7 @@ class ProjectAssetEndpoint(BaseAPIView):
# update the attributes # update the attributes
asset.attributes = request.data.get("attributes", asset.attributes) asset.attributes = request.data.get("attributes", asset.attributes)
# save the asset # save the asset
asset.save() asset.save(created_by=request.user)
return Response(status=status.HTTP_204_NO_CONTENT) return Response(status=status.HTTP_204_NO_CONTENT)
@allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST]) @allow_permission([ROLE.ADMIN, ROLE.MEMBER, ROLE.GUEST])

View file

@ -257,5 +257,5 @@ class IssueAttachmentV2Endpoint(BaseAPIView):
# Get the storage metadata # Get the storage metadata
if not issue_attachment.storage_metadata: if not issue_attachment.storage_metadata:
get_asset_object_metadata.delay(str(issue_attachment.id)) get_asset_object_metadata.delay(str(issue_attachment.id))
issue_attachment.save() issue_attachment.save(created_by=request.user)
return Response(status=status.HTTP_204_NO_CONTENT) return Response(status=status.HTTP_204_NO_CONTENT)

View file

@ -169,7 +169,7 @@ class EntityAssetEndpoint(BaseAPIView):
# update the attributes # update the attributes
asset.attributes = request.data.get("attributes", asset.attributes) asset.attributes = request.data.get("attributes", asset.attributes)
# save the asset # save the asset
asset.save() asset.save(created_by=request.user)
return Response(status=status.HTTP_204_NO_CONTENT) return Response(status=status.HTTP_204_NO_CONTENT)
def delete(self, request, anchor, pk): def delete(self, request, anchor, pk):