From c89982d4909f116d21b51c448d6df141011a6a2e Mon Sep 17 00:00:00 2001 From: rizwanisready Date: Wed, 8 May 2024 20:38:35 +0530 Subject: [PATCH] player ID delete api 2 --- manage_notifications/api/views.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/manage_notifications/api/views.py b/manage_notifications/api/views.py index 7844e53..bf8b23f 100644 --- a/manage_notifications/api/views.py +++ b/manage_notifications/api/views.py @@ -114,10 +114,8 @@ class DeletePlayerID(APIView): def post(self, request): try: - if hasattr(request.user, "player_id"): - request.user.player_id = ( - None # or use a dedicated method to delete the player ID - ) + if request.user.player_id: + del request.user.player_id return ApiResponse.success( message=constants.SUCCESS, data="Player ID Deleted Successfully!",