From 4bd466c16b886258f12fa4c0ee2067f2b5f4694a Mon Sep 17 00:00:00 2001 From: pablohashescobar Date: Wed, 22 Nov 2023 13:22:04 +0530 Subject: [PATCH] dev: error messages for deactivation --- apiserver/plane/app/views/user.py | 2 +- apiserver/plane/app/views/workspace.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apiserver/plane/app/views/user.py b/apiserver/plane/app/views/user.py index ed1178886..e45a3e2f4 100644 --- a/apiserver/plane/app/views/user.py +++ b/apiserver/plane/app/views/user.py @@ -48,7 +48,7 @@ class UserEndpoint(BaseViewSet): if WorkspaceMember.objects.filter(member=request.user, is_active=True).exists(): return Response( { - "error": "User cannot deactivate account as user is active in some workspaces" + "error": "You cannot deactivate account as you are a member in some workspaces." }, status=status.HTTP_400_BAD_REQUEST, ) diff --git a/apiserver/plane/app/views/workspace.py b/apiserver/plane/app/views/workspace.py index 637fc95b5..74ee07b04 100644 --- a/apiserver/plane/app/views/workspace.py +++ b/apiserver/plane/app/views/workspace.py @@ -600,7 +600,7 @@ class WorkSpaceMemberViewSet(BaseViewSet): ): return Response( { - "error": "User is part of some projects where they are the only admin you should leave that project first" + "error": "User is a part of some projects where they are the only admin, they should either leave that project or promote another user to admin." }, status=status.HTTP_400_BAD_REQUEST, ) @@ -635,7 +635,7 @@ class WorkSpaceMemberViewSet(BaseViewSet): ): return Response( { - "error": "You cannot leave the workspace as your the only admin of the workspace you will have to either delete the workspace or create an another admin" + "error": "You cannot leave the workspace as you are the only admin of the workspace you will have to either delete the workspace or promote another user to admin." }, status=status.HTTP_400_BAD_REQUEST, ) @@ -656,7 +656,7 @@ class WorkSpaceMemberViewSet(BaseViewSet): ): return Response( { - "error": "User is part of some projects where they are the only admin you should leave that project first" + "error": "You are a part of some projects where you are the only admin, you should either leave the project or promote another user to admin." }, status=status.HTTP_400_BAD_REQUEST, )