From be8c311307fd6e1e35cee12282d0424c0d1f050c Mon Sep 17 00:00:00 2001 From: yashsinghcodes Date: Sat, 11 Jan 2025 01:38:02 +0530 Subject: [PATCH] fixed list condition check --- shuffle-tools/1.2.0/src/app.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/shuffle-tools/1.2.0/src/app.py b/shuffle-tools/1.2.0/src/app.py index 934cd364..ef7eb955 100644 --- a/shuffle-tools/1.2.0/src/app.py +++ b/shuffle-tools/1.2.0/src/app.py @@ -1816,6 +1816,7 @@ def check_cache_contains(self, key, value, append): "search": str(value), "key": key, } + directcall = False allvalues = {} try: @@ -1859,6 +1860,7 @@ def check_cache_contains(self, key, value, append): if "success" not in allvalues: get_response = requests.post(url, json=data, verify=False) allvalues = get_response.json() + directcall = True try: if allvalues["value"] == None or allvalues["value"] == "null": @@ -1977,11 +1979,13 @@ def check_cache_contains(self, key, value, append): if value not in allvalues["value"] and isinstance(allvalues["value"], list): self.cache_update_buffer.append(value) allvalues["value"].append(value) - #set_url = "%s/api/v1/orgs/%s/set_cache" % (self.url, org_id) - #response = requests.post(set_url, json=data, verify=False) exception = "" try: - #allvalues = response.json() + if directcall: + set_url = "%s/api/v1/orgs/%s/set_cache" % (self.url, org_id) + response = requests.post(set_url, json=data, verify=False) + allvalues = response.json() + #return allvalues return {