From dc18941fa8e1022f8e674021793f170da74d5dff Mon Sep 17 00:00:00 2001 From: Matthew Esposito Date: Mon, 4 Nov 2024 13:22:47 -0500 Subject: [PATCH] fix(workspaces): properly rename deleted workspaces --- backend/scopeBackend/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/scopeBackend/views.py b/backend/scopeBackend/views.py index 7ed3c81..9b4daba 100644 --- a/backend/scopeBackend/views.py +++ b/backend/scopeBackend/views.py @@ -263,7 +263,9 @@ def delete(self, request): if workspace.creatorId != self.request.user: return Response({'error':'Only the workspace creator can delete'}, status=status.HTTP_403_FORBIDDEN) # workspace.delete() - #workspace.hidden = True + workspace.hidden = True + workspace.name = workspace.name + "_deleted_" + __import__('os').urandom(15).hex() + workspace.save() return Response('Workspace has been deleted', status=status.HTTP_200_OK) # accessible at /api/workspaces/ [POST]