From 686eeee8b650fdffd0180c3775ca68884f019b14 Mon Sep 17 00:00:00 2001 From: khavinshankar Date: Thu, 20 Jul 2023 16:25:08 +0530 Subject: [PATCH] removed unwanted prints --- care/abdm/api/viewsets/auth.py | 17 ++--------------- care/abdm/api/viewsets/hip.py | 1 - care/abdm/api/viewsets/status.py | 4 +--- care/abdm/utils/api_call.py | 4 ---- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/care/abdm/api/viewsets/auth.py b/care/abdm/api/viewsets/auth.py index 020cbde7ab..ca240a4098 100644 --- a/care/abdm/api/viewsets/auth.py +++ b/care/abdm/api/viewsets/auth.py @@ -21,8 +21,9 @@ class OnFetchView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print("on-fetch-modes", data) + AbdmGateway().init(data["resp"]["requestId"]) + return Response({}, status=status.HTTP_202_ACCEPTED) @@ -32,7 +33,6 @@ class OnInitView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print("on-init", data) AbdmGateway().confirm(data["auth"]["transactionId"], data["resp"]["requestId"]) @@ -45,7 +45,6 @@ class OnConfirmView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print(data) if "validity" in data["auth"]: if data["auth"]["validity"]["purpose"] == "LINK": @@ -79,7 +78,6 @@ class AuthNotifyView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print("auth-notify", data) if data["auth"]["status"] != "GRANTED": return @@ -108,7 +106,6 @@ class DiscoverView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print(data) patients = PatientRegistration.objects.all() verified_identifiers = data["patient"]["verifiedIdentifiers"] @@ -232,9 +229,7 @@ class NotifyView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print(data) - # TODO: create a seperate cache and also add a expiration time cache.set(data["notification"]["consentId"], json.dumps(data)) AbdmGateway().on_notify( @@ -252,9 +247,7 @@ class RequestDataView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print(data) - # TODO: uncomment later consent_id = data["hiRequest"]["consent"]["id"] consent = json.loads(cache.get(consent_id)) if consent_id in cache else None if not consent or not consent["notification"]["status"] == "GRANTED": @@ -286,8 +279,6 @@ def post(self, request, *args, **kwargs): data["hiRequest"]["keyMaterial"]["nonce"], ) - print(consent["notification"]["consentDetail"]["careContexts"][:1:-1]) - AbdmGateway().data_transfer( { "transaction_id": data["transactionId"], @@ -335,10 +326,6 @@ def post(self, request, *args, **kwargs): } ) - print("______________________________________________") - print(consent["notification"]["consentDetail"]["careContexts"][:-2:-1]) - print("______________________________________________") - AbdmGateway().data_notify( { "consent_id": data["hiRequest"]["consent"]["id"], diff --git a/care/abdm/api/viewsets/hip.py b/care/abdm/api/viewsets/hip.py index 4958e23d94..9cae1efdbf 100644 --- a/care/abdm/api/viewsets/hip.py +++ b/care/abdm/api/viewsets/hip.py @@ -26,7 +26,6 @@ def get_linking_token(self, data): @action(detail=False, methods=["POST"]) def share(self, request, *args, **kwargs): data = request.data - print(data) patient_data = data["profile"]["patient"] counter_id = ( diff --git a/care/abdm/api/viewsets/status.py b/care/abdm/api/viewsets/status.py index 3da724c722..05ef33757b 100644 --- a/care/abdm/api/viewsets/status.py +++ b/care/abdm/api/viewsets/status.py @@ -15,7 +15,6 @@ class NotifyView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print("patient_status_notify", data) PatientRegistration.objects.filter( abha_number__health_id=data["notification"]["patient"]["id"] @@ -35,6 +34,5 @@ class SMSOnNotifyView(GenericAPIView): def post(self, request, *args, **kwargs): data = request.data - print("patient_sms_on_notify", data) - + print(data) return Response(status=status.HTTP_202_ACCEPTED) diff --git a/care/abdm/utils/api_call.py b/care/abdm/utils/api_call.py index 6fcc8c244a..3ae10d8075 100644 --- a/care/abdm/utils/api_call.py +++ b/care/abdm/utils/api_call.py @@ -437,8 +437,6 @@ def init(self, prev_request_id): data = self.temp_memory[prev_request_id] self.temp_memory[request_id] = data - print("auth-init", data) - payload = { "requestId": request_id, "timestamp": str( @@ -483,8 +481,6 @@ def confirm(self, transaction_id, prev_request_id): }, } - print(payload) - response = self.api.post(path, payload, None, additional_headers) return response