Skip to content
Snippets Groups Projects
Commit e4069708 authored by Robert Latta's avatar Robert Latta
Browse files

priorised Customer Contacts over Vendor Contacts

parent de506e31
No related branches found
No related tags found
No related merge requests found
......@@ -222,10 +222,14 @@ def otrs_get_customer_users_rows(ds):
'city', 'country', 'comments']
def get_all_cus_user_rows():
yield from otrs_get_customer_contacts(ds)
yield from otrs_get_vendor_contacts(ds)
yielded_customer_emails = set()
for c in otrs_get_customer_contacts(ds):
yielded_customer_emails.add(c['email'])
yield c
for c in otrs_get_vendor_contacts(ds):
if c['email'] not in yielded_customer_emails:
yield c
sorted_cus = sorted(get_all_cus_user_rows(), key=lambda x: x['email'])
# this will be used to prioritisation
for cu in sorted_cus:
yield list(cu.values())
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment