From 2207b23e9b4223677b7027b3b7389e87fccf1c90 Mon Sep 17 00:00:00 2001 From: imPratik Date: Sun, 5 May 2024 18:05:31 +0530 Subject: [PATCH] handling of request inputs corrected based on request type --- amenity_pj/apps/app_asn1_play.py | 2 +- amenity_pj/apps/app_cert_play.py | 2 +- amenity_pj/apps/app_qr_play.py | 2 +- amenity_pj/apps/app_tlv_play.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/amenity_pj/apps/app_asn1_play.py b/amenity_pj/apps/app_asn1_play.py index 81ded15..110d05e 100644 --- a/amenity_pj/apps/app_asn1_play.py +++ b/amenity_pj/apps/app_asn1_play.py @@ -158,7 +158,7 @@ def handle_requests(api=False): } log_req = f'{Const.TEMPLATE_ASN1_PLAY}; {request.method}; {"API" if api else "Form"} Request' PhUtil.print_separator(main_text=f'{log_req} Received!!!') - requested_data_dict = request.get_json() if api else request.form.to_dict() + requested_data_dict = request.get_json() if request.is_json else request.form.to_dict() PhUtil.print_iter(requested_data_dict, header='Inputs') if request.method == PhKeys.GET: pass diff --git a/amenity_pj/apps/app_cert_play.py b/amenity_pj/apps/app_cert_play.py index a9b6d24..5f9a1e6 100644 --- a/amenity_pj/apps/app_cert_play.py +++ b/amenity_pj/apps/app_cert_play.py @@ -59,7 +59,7 @@ def handle_requests(api=False): } log_req = f'{Const.TEMPLATE_CERT_PLAY}; {request.method}; {"API" if api else "Form"} Request' PhUtil.print_separator(main_text=f'{log_req} Received!!!') - requested_data_dict = request.get_json() if api else request.form.to_dict() + requested_data_dict = request.get_json() if request.is_json else request.form.to_dict() PhUtil.print_iter(requested_data_dict, header='Inputs') if request.method == PhKeys.GET: pass diff --git a/amenity_pj/apps/app_qr_play.py b/amenity_pj/apps/app_qr_play.py index fbbe19b..cdf8473 100644 --- a/amenity_pj/apps/app_qr_play.py +++ b/amenity_pj/apps/app_qr_play.py @@ -76,7 +76,7 @@ def handle_requests(api=False): } log_req = f'{Const.TEMPLATE_QR_PLAY}; {request.method}; {"API" if api else "Form"} Request' PhUtil.print_separator(main_text=f'{log_req} Received!!!') - requested_data_dict = request.get_json() if api else request.form.to_dict() + requested_data_dict = request.get_json() if request.is_json else request.form.to_dict() PhUtil.print_iter(requested_data_dict, header='Inputs') if request.method == PhKeys.GET: pass diff --git a/amenity_pj/apps/app_tlv_play.py b/amenity_pj/apps/app_tlv_play.py index 7ddd930..362a1b0 100644 --- a/amenity_pj/apps/app_tlv_play.py +++ b/amenity_pj/apps/app_tlv_play.py @@ -85,7 +85,7 @@ def handle_requests(api=False): } log_req = f'{Const.TEMPLATE_TLV_PLAY}; {request.method}; {"API" if api else "Form"} Request' PhUtil.print_separator(main_text=f'{log_req} Received!!!') - requested_data_dict = request.get_json() if api else request.form.to_dict() + requested_data_dict = request.get_json() if request.is_json else request.form.to_dict() PhUtil.print_iter(requested_data_dict, header='Inputs') if request.method == PhKeys.GET: pass