From 5255db09501a540522c141fbdf6544e5367927ff Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 15 Oct 2024 12:27:11 -0500 Subject: [PATCH] Move dev logging inside loop --- emails/views.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/emails/views.py b/emails/views.py index dc40372689..5e96525cc5 100644 --- a/emails/views.py +++ b/emails/views.py @@ -1839,15 +1839,17 @@ def _handle_complaint(message_json: AWS_SNSMessageJSON) -> HttpResponse: _disable_masks_for_complaint(message_json, user) + if flag_is_active_in_task("developer_mode", user): + # MPP-3932: We need more information to match complaints to masks + dev_action = DeveloperModeAction(mask_id="unknown", action="log") + _log_dev_notification( + "_handle_complaint: MPP-3932", dev_action, message_json + ) + if not complaint_data: # Data when there are no identified recipients complaint_data = [{"user_match": "no_recipients", "relay_action": "no_action"}] - if flag_is_active_in_task("developer_mode", user): - # MPP-3932: We need more information to match complaints to masks - dev_action = DeveloperModeAction(mask_id="unknown", action="log") - _log_dev_notification("_handle_complaint: MPP-3932", dev_action, message_json) - for data in complaint_data: tags = { "complaint_subtype": subtype or "none",