From 581235c1dcfd652e3e49016000ddf1f8351d4ead Mon Sep 17 00:00:00 2001 From: David Whittaker <84562015+whitdog47@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:38:24 -0700 Subject: [PATCH] Only collect participant emails if individual exists (#5351) --- src/dispatch/search/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dispatch/search/views.py b/src/dispatch/search/views.py index 271f39b07bc0..bd2dc101acdf 100644 --- a/src/dispatch/search/views.py +++ b/src/dispatch/search/views.py @@ -40,7 +40,9 @@ def search( current_user_email = common["current_user"].email for incident in results["Incident"]: participant_emails: list[str] = [ - participant.individual.email for participant in incident.participants + participant.individual.email + for participant in incident.participants + if participant.individual ] if ( incident.project in admin_projects