From f64ecdfc66c3cc2f533e60b272ccd28d240b7654 Mon Sep 17 00:00:00 2001 From: Pierre Chabardes Date: Wed, 23 Jan 2019 18:35:10 +0100 Subject: [PATCH 1/2] return response with error if request failed --- zoho/books/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zoho/books/client.py b/zoho/books/client.py index 44fdbbf..65477f9 100644 --- a/zoho/books/client.py +++ b/zoho/books/client.py @@ -58,4 +58,4 @@ def get_specific_record(self, module, id): if response and 'data' in response and len(response['data']) > 0 and response['data'][0]['id'] == id: return response['data'] else: - return False + return response From ad297ee44af9450f82957a85ae27429771eb926b Mon Sep 17 00:00:00 2001 From: Pierre Chabardes Date: Thu, 24 Jan 2019 12:26:01 +0100 Subject: [PATCH 2/2] send response as it is --- zoho/books/client.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/zoho/books/client.py b/zoho/books/client.py index 65477f9..7a83647 100644 --- a/zoho/books/client.py +++ b/zoho/books/client.py @@ -54,8 +54,4 @@ def get_specific_record(self, module, id): params = {'organization_id': self._organization_id} if self._organization_id is not None else {} - response = self._get(url, params=params) - if response and 'data' in response and len(response['data']) > 0 and response['data'][0]['id'] == id: - return response['data'] - else: - return response + return self._get(url, params=params)