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"])
|
||||
if filtervalue is None:
|
||||
continue
|
||||
|
||||
resolvedvalue = dictionary.get(filter["filterkey"])
|
||||
|
||||
if filter["operator"] == ">=":
|
||||
if dictionary.get(filter["filterkey"]) >= int(filtervalue):
|
||||
if int(resolvedvalue or 0) >= int(filtervalue):
|
||||
print(filter["print"])
|
||||
return True, filter
|
||||
|
||||
if filter["operator"] == "<=":
|
||||
if dictionary.get(filter["filterkey"]) <= int(filtervalue):
|
||||
if int(resolvedvalue or 0) <= int(filtervalue):
|
||||
print(filter["print"])
|
||||
return True, filter
|
||||
|
||||
if filter["operator"] == "==":
|
||||
if dictionary.get(filter["filterkey"]) == filtervalue:
|
||||
if resolvedvalue == filtervalue:
|
||||
print(filter["print"])
|
||||
return True, filter
|
||||
|
||||
if filter["operator"] == "!=":
|
||||
if dictionary.get(filter["filterkey"]) != filtervalue:
|
||||
if resolvedvalue != filtervalue:
|
||||
print(filter["print"])
|
||||
return True, filter
|
||||
|
||||
if filter["operator"] == ">":
|
||||
if dictionary.get(filter["filterkey"]) > int(filtervalue):
|
||||
if int(resolvedvalue or 0) > int(filtervalue):
|
||||
print(filter["print"])
|
||||
return True, filter
|
||||
|
||||
if filter["operator"] == "<":
|
||||
if dictionary.get(filter["filterkey"]) < int(filtervalue):
|
||||
if int(resolvedvalue or 0) < int(filtervalue):
|
||||
print(filter["print"])
|
||||
return True, filter
|
||||
|
||||
|
||||
Reference in New Issue
Block a user