From f8343fe3e92367f3e22f326ae2bfe45bc01c200c Mon Sep 17 00:00:00 2001 From: Ashutosh619-sudo Date: Sun, 13 Oct 2024 22:16:33 +0530 Subject: [PATCH] comment resolved --- sageintacctsdk/apis/api_base.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sageintacctsdk/apis/api_base.py b/sageintacctsdk/apis/api_base.py index d00187f..8a30c07 100644 --- a/sageintacctsdk/apis/api_base.py +++ b/sageintacctsdk/apis/api_base.py @@ -201,7 +201,12 @@ def __post_request(self, dict_body: dict, api_url: str): parsed_response = json.loads(json.dumps(parsed_xml)) if raw_response.status_code == 200: - logger.debug('Response for post request: %s', raw_response.text) + if (parsed_response['response']['control']['status'] == 'failure' or parsed_response['response']['operation']['authentication']['status'] == 'failure' or \ + parsed_response['response']['operation']['result']['status'] == 'failure'): + logger.info('Response for post request: %s', raw_response.text) + else: + logger.debug('Response for post request: %s', raw_response.text) + if parsed_response['response']['control']['status'] == 'success': api_response = parsed_response['response']['operation']