Skip to content

Commit

Permalink
handling of request inputs corrected based on request type
Browse files Browse the repository at this point in the history
  • Loading branch information
impratikjaiswal committed May 5, 2024
1 parent 6dd74cd commit 2207b23
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion amenity_pj/apps/app_asn1_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion amenity_pj/apps/app_cert_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion amenity_pj/apps/app_qr_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion amenity_pj/apps/app_tlv_play.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2207b23

Please sign in to comment.