solved account deleted bug

This commit is contained in:
rizwanisready
2024-05-27 16:03:41 +05:30
parent df59f0714e
commit 97bae9e940
2 changed files with 1 additions and 3 deletions

View File

@@ -937,7 +937,7 @@ class SoftDeletePrincipalAPIView(APIView):
def delete(self, request, format=None):
principal = request.user
if principal.deleted: # Check if already deleted
if not principal.is_active: # Check if already deleted
return ApiResponse.error(
status=status.HTTP_400_BAD_REQUEST,
message="Account already deleted.",
@@ -945,7 +945,6 @@ class SoftDeletePrincipalAPIView(APIView):
)
principal.is_active = False
principal.deleted = True
principal.save()
return ApiResponse.success(
status=status.HTTP_200_OK,

View File

@@ -72,7 +72,6 @@ class IAmPrincipalForm(forms.ModelForm):
"password",
"confirm_password",
"is_active",
"deleted",
]
def __init__(self, *args, **kwargs):