From f5b49caca78458adaf0a9b7f1fcf64bb2aa55014 Mon Sep 17 00:00:00 2001 From: Avery Date: Mon, 27 Nov 2023 10:51:09 -0800 Subject: [PATCH] Fixes signal instance deduplication check. (#4012) * Deduplicating signal instances should only occur when those instances are associated with a case. * Checks for existing cases before signal deduplication. --------- Co-authored-by: kevgliss --- src/dispatch/signal/flows.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dispatch/signal/flows.py b/src/dispatch/signal/flows.py index 4891abf2dfad..141808840526 100644 --- a/src/dispatch/signal/flows.py +++ b/src/dispatch/signal/flows.py @@ -81,9 +81,9 @@ def signal_instance_create_flow( db_session=db_session, signal_instance=signal_instance, ): - # If the signal was deduplicated, we can assume a case exists, - # and we need to update the corresponding signal message - if _should_update_signal_message(signal_instance): + # If a case exists and the signal was deduplicated, + # we need to update the corresponding signal message + if signal_instance.case_id and _should_update_signal_message(signal_instance): update_signal_message( db_session=db_session, signal_instance=signal_instance,