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):
# Function input dictionary from client
# Function output boolean true if match else False
def query_valid(data: dict):
if data != {}:
# print(data["parameters"])
if (data["parameters"] == 'response'):
if 'parameters' in data:
if (data['parameters'] != '') & (len(data) <= 2):
return True
else:
return False
else:
raise Exception("Dictionnaire Vide!!")
# Function json_loads changes a json file into a Dict
......@@ -134,9 +131,8 @@ def check_and_complete_parameters(data):
tool = list(data.keys())[0]
s = db.getParameters({tool})
parameter = {}
query = {}
if s is not None:
gen = s[0]
# gen = s[0]
parameter = s[1]
q = data.get(tool)
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