Updates for Cvent, IDAA, and general clean up

This commit is contained in:
Scott Idem
2022-03-15 16:00:57 -04:00
parent 34c6c9e6bd
commit c380516855
2 changed files with 11 additions and 0 deletions

View File

@@ -473,12 +473,18 @@ def create_update_aether_person(
# Important variables used more than once.
person_external_id = None
status = None
if custom_field_list := cvent_contact_obj.get('customFields'): # List
for custom_field in custom_field_list:
# Get the External ID created by OSIT
if custom_field.get('id') == '609ab766-7d79-4a9d-a72c-f126412659ee':
# person_data['external_id'] = custom_field.get('value')[0]
person_external_id = custom_field.get('value')[0]
# Get the (Contact) Status created by OSIT
if custom_field.get('id') == 'e4e51781-e1ec-4f61-8329-b5d29bec6886':
# person_data['external_id'] = custom_field.get('value')[0]
status = custom_field.get('value')[0].lower()
email = cvent_contact_obj.get('email')
membership_person_id = None
membership_person_type_id = None
@@ -495,6 +501,7 @@ def create_update_aether_person(
person_data['designations'] = cvent_contact_obj.get('designation')
person_data['professional_title'] = cvent_contact_obj.get('title')
person_data['affiliations'] = cvent_contact_obj.get('company')
person_data['status'] = status
person_data['enable'] = True
log.debug(person_data)