Fix larger/smaller condition
This commit is contained in:
@@ -1214,27 +1214,13 @@ class AppBase:
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
elif check.lower() == "larger than":
|
elif check.lower() == "larger than":
|
||||||
try:
|
if str(sourcevalue).isdigit() and str(destinationvalue).isdigit():
|
||||||
if sourcevalue.isdigit() and destinationvalue.isdigit():
|
if int(sourcevalue) > int(destinationvalue):
|
||||||
if int(sourcevalue) > int(destinationvalue):
|
return True
|
||||||
return True
|
|
||||||
|
|
||||||
print("Not larger than.")
|
|
||||||
return False
|
|
||||||
except AttributeError as e:
|
|
||||||
self.logger.error("Condition larger than failed with values %s and %s: %s" % (sourcevalue, destinationvalue, e))
|
|
||||||
return False
|
|
||||||
elif check.lower() == "smaller than":
|
elif check.lower() == "smaller than":
|
||||||
try:
|
if str(sourcevalue).isdigit() and str(destinationvalue).isdigit():
|
||||||
if sourcevalue.isdigit() and destinationvalue.isdigit():
|
if int(sourcevalue) < int(destinationvalue):
|
||||||
if int(sourcevalue) < int(destinationvalue):
|
return True
|
||||||
return True
|
|
||||||
|
|
||||||
print("Not small than.")
|
|
||||||
return False
|
|
||||||
except AttributeError as e:
|
|
||||||
self.logger.error("Condition smaller than failed with values %s and %s: %s" % (sourcevalue, destinationvalue, e))
|
|
||||||
return False
|
|
||||||
else:
|
else:
|
||||||
self.logger.info("Condition: can't handle %s yet. Setting to true" % check)
|
self.logger.info("Condition: can't handle %s yet. Setting to true" % check)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user