Skip to content

Commit

Permalink
removed unwanted prints
Browse files Browse the repository at this point in the history
  • Loading branch information
khavinshankar committed Jul 20, 2023
1 parent f59396a commit 686eeee
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
17 changes: 2 additions & 15 deletions care/abdm/api/viewsets/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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"])

Expand All @@ -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":
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"]
Expand Down Expand Up @@ -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(
Expand All @@ -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":
Expand Down Expand Up @@ -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"],
Expand Down Expand Up @@ -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"],
Expand Down
1 change: 0 additions & 1 deletion care/abdm/api/viewsets/hip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down
4 changes: 1 addition & 3 deletions care/abdm/api/viewsets/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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)
4 changes: 0 additions & 4 deletions care/abdm/utils/api_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 686eeee

Please sign in to comment.