Upgraded applyConditions to better handle None type Errors
This commit is contained in:
@@ -9,34 +9,36 @@ def applyConditions(definition, dictionary, outputs):
|
|||||||
filtervalue = outputs.get(filtervalue["outputs"])
|
filtervalue = outputs.get(filtervalue["outputs"])
|
||||||
if filtervalue is None:
|
if filtervalue is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
resolvedvalue = dictionary.get(filter["filterkey"])
|
||||||
|
|
||||||
if filter["operator"] == ">=":
|
if filter["operator"] == ">=":
|
||||||
if dictionary.get(filter["filterkey"]) >= int(filtervalue):
|
if int(resolvedvalue or 0) >= int(filtervalue):
|
||||||
print(filter["print"])
|
print(filter["print"])
|
||||||
return True, filter
|
return True, filter
|
||||||
|
|
||||||
if filter["operator"] == "<=":
|
if filter["operator"] == "<=":
|
||||||
if dictionary.get(filter["filterkey"]) <= int(filtervalue):
|
if int(resolvedvalue or 0) <= int(filtervalue):
|
||||||
print(filter["print"])
|
print(filter["print"])
|
||||||
return True, filter
|
return True, filter
|
||||||
|
|
||||||
if filter["operator"] == "==":
|
if filter["operator"] == "==":
|
||||||
if dictionary.get(filter["filterkey"]) == filtervalue:
|
if resolvedvalue == filtervalue:
|
||||||
print(filter["print"])
|
print(filter["print"])
|
||||||
return True, filter
|
return True, filter
|
||||||
|
|
||||||
if filter["operator"] == "!=":
|
if filter["operator"] == "!=":
|
||||||
if dictionary.get(filter["filterkey"]) != filtervalue:
|
if resolvedvalue != filtervalue:
|
||||||
print(filter["print"])
|
print(filter["print"])
|
||||||
return True, filter
|
return True, filter
|
||||||
|
|
||||||
if filter["operator"] == ">":
|
if filter["operator"] == ">":
|
||||||
if dictionary.get(filter["filterkey"]) > int(filtervalue):
|
if int(resolvedvalue or 0) > int(filtervalue):
|
||||||
print(filter["print"])
|
print(filter["print"])
|
||||||
return True, filter
|
return True, filter
|
||||||
|
|
||||||
if filter["operator"] == "<":
|
if filter["operator"] == "<":
|
||||||
if dictionary.get(filter["filterkey"]) < int(filtervalue):
|
if int(resolvedvalue or 0) < int(filtervalue):
|
||||||
print(filter["print"])
|
print(filter["print"])
|
||||||
return True, filter
|
return True, filter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user