Add "does not begin with" and "does not end with" condition operators

This commit is contained in:
JonnyWong16 2022-08-19 10:41:02 -07:00
parent 3c40f83738
commit ac520d656b
No known key found for this signature in database
GPG key ID: B1F1F9807184697A

View file

@ -339,9 +339,15 @@ def notify_custom_conditions(notifier_id=None, parameters=None):
elif operator == 'begins with':
evaluated = parameter_value.startswith(tuple(values))
elif operator == 'does not begin with':
evaluated = not parameter_value.startswith(tuple(values))
elif operator == 'ends with':
evaluated = parameter_value.endswith(tuple(values))
elif operator == 'does not end with':
evaluated = not parameter_value.endswith(tuple(values))
elif operator == 'is greater than':
evaluated = any(parameter_value > c for c in values)