Commit 52275c09 authored by Ismail Moumni's avatar Ismail Moumni
Browse files

correcting query_valid

parent f0b45c13
Pipeline #1322 failed with stage
in 12 seconds
...@@ -71,14 +71,11 @@ def query_client(addr, data): ...@@ -71,14 +71,11 @@ def query_client(addr, data):
# Function input dictionary from client # Function input dictionary from client
# Function output boolean true if match else False # Function output boolean true if match else False
def query_valid(data: dict): def query_valid(data: dict):
if data != {}: if 'parameters' in data:
# print(data["parameters"]) if (data['parameters'] != '') & (len(data) <= 2):
if (data["parameters"] == 'response'):
return True return True
else: else:
return False return False
else:
raise Exception("Dictionnaire Vide!!")
# Function json_loads changes a json file into a Dict # Function json_loads changes a json file into a Dict
...@@ -134,9 +131,8 @@ def check_and_complete_parameters(data): ...@@ -134,9 +131,8 @@ def check_and_complete_parameters(data):
tool = list(data.keys())[0] tool = list(data.keys())[0]
s = db.getParameters({tool}) s = db.getParameters({tool})
parameter = {} parameter = {}
query = {}
if s is not None: if s is not None:
gen = s[0] # gen = s[0]
parameter = s[1] parameter = s[1]
q = data.get(tool) q = data.get(tool)
if match_query_dict(parameter.get(tool), q): if match_query_dict(parameter.get(tool), q):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment