From c52f95e95fcd350a6bfc6bd2cd3232a621e30c02 Mon Sep 17 00:00:00 2001 From: customr Date: Wed, 17 Mar 2021 21:58:34 +0400 Subject: [PATCH] Fix Base.parameters. Now they will refresh after making a requests --- retailcrm/versions/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/retailcrm/versions/base.py b/retailcrm/versions/base.py index 09dbbeb..302a26f 100644 --- a/retailcrm/versions/base.py +++ b/retailcrm/versions/base.py @@ -30,6 +30,7 @@ class Base(object): requests_url = base_url + url if not self.parameters else base_url + url + "?" + query_builder(self.parameters) response = requests.get(requests_url, headers={ 'X-API-KEY': self.api_key}) + self.parameters = {} return Response(response.status_code, response.json()) @@ -42,7 +43,8 @@ class Base(object): requests_url = base_url + url response = requests.post(requests_url, data=self.parameters, headers={ 'X-API-KEY': self.api_key}) - + self.parameters = {} + return Response(response.status_code, response.json()) def api_versions(self):