Fix trigger type equality check

This commit is contained in:
shamoon 2023-12-31 10:54:37 -08:00
parent 3a2117e4b7
commit 627b01f971

View File

@ -398,14 +398,14 @@ def document_matches_workflow(
logger.debug(f"No matching triggers with type {trigger_type} found") logger.debug(f"No matching triggers with type {trigger_type} found")
else: else:
for trigger in workflow.triggers.filter(type=trigger_type): for trigger in workflow.triggers.filter(type=trigger_type):
if trigger_type is WorkflowTrigger.WorkflowTriggerType.CONSUMPTION: if trigger_type == WorkflowTrigger.WorkflowTriggerType.CONSUMPTION:
trigger_matched, reason = consumable_document_matches_workflow( trigger_matched, reason = consumable_document_matches_workflow(
document, document,
trigger, trigger,
) )
elif ( elif (
trigger_type is WorkflowTrigger.WorkflowTriggerType.DOCUMENT_ADDED trigger_type == WorkflowTrigger.WorkflowTriggerType.DOCUMENT_ADDED
or trigger_type is WorkflowTrigger.WorkflowTriggerType.DOCUMENT_UPDATED or trigger_type == WorkflowTrigger.WorkflowTriggerType.DOCUMENT_UPDATED
): ):
trigger_matched, reason = existing_document_matches_workflow( trigger_matched, reason = existing_document_matches_workflow(
document, document,