From e2dc042afeae69dbdb70071a66d436398448e151 Mon Sep 17 00:00:00 2001
From: Robert Latta <robert.latta@geant.org>
Date: Mon, 5 Sep 2022 12:03:52 +0100
Subject: [PATCH] updated source for populating contacts RE DBOARD3-663

---
 inventory_provider/db/ims_data.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/inventory_provider/db/ims_data.py b/inventory_provider/db/ims_data.py
index 66583ae0..20efd5c1 100644
--- a/inventory_provider/db/ims_data.py
+++ b/inventory_provider/db/ims_data.py
@@ -109,18 +109,14 @@ def get_service_types(ds: IMS):
 def get_customer_service_emails(ds: IMS):
 
     customer_contacts = defaultdict(set)
+
     for x in ds.get_filtered_entities(
         'customerrelatedcontact',
-        "contact.plannedworkmail != '' | contact.mail != ''",
-        CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact']
-    ):
-        customer_contacts[x['customerid']].add(x['contact']['mail'])
-    for x in ds.get_filtered_entities(
-        'customerrelatedcontact',
-        "contact.troubleticketMail != '' | contact.mail != ''",
+        "contact.troubleticketMail != ''",
         CUSTOMER_RELATED_CONTACT_PROPERTIES['Contact']
     ):
-        customer_contacts[x['customerid']].add(x['contact']['mail'])
+        customer_contacts[x['customerid']].add(
+            x['contact']['troubleticketMail'])
     for k, v in customer_contacts.items():
         yield k, sorted(list(v))
 
-- 
GitLab