From 743ba38f93d58f4320114070d595167817da929f Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Fri, 9 Feb 2024 07:25:48 -0800 Subject: [PATCH] Fix: only check workflow source if not empty --- src/documents/matching.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/documents/matching.py b/src/documents/matching.py index 81154b8f4..6ffa1b3aa 100644 --- a/src/documents/matching.py +++ b/src/documents/matching.py @@ -258,7 +258,9 @@ def consumable_document_matches_workflow( reason = "" # Document source vs trigger source - if document.source not in [int(x) for x in list(trigger.sources)]: + if len(trigger.sources) > 0 and document.source not in [ + int(x) for x in list(trigger.sources) + ]: reason = ( f"Document source {document.source.name} not in" f" {[DocumentSource(int(x)).name for x in trigger.sources]}",