Fix for Impexium and allow_access field.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import datetime, json, pytz, secrets, time
|
||||
import datetime, json, pytz, random, secrets, time
|
||||
import pandas, xlrd # qrcode
|
||||
from fastapi import APIRouter, Body, Depends, Header, HTTPException, Query, Response, status
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
@@ -71,6 +71,15 @@ async def event_import_reg(
|
||||
event_person_summary_li = []
|
||||
for event_registrant in event_registrant_li:
|
||||
if loop_count > loop_limit: break
|
||||
|
||||
# if rand
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
rand_number = random.choices(['HEADS', 'TAILS'], [3, 7])[0] # 70% chance to process this record!
|
||||
log.debug(f'Random Number: {rand_number}')
|
||||
if rand_number == 'HEADS':
|
||||
continue
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
|
||||
log.warning(f'BEGIN: **** *** ** * Impexium registrant import loop #{loop_count} * ** *** ****')
|
||||
# ISHLT 2022 used event_registrant.get('registrantTypeCode') for the registration type
|
||||
# ISHLT 2023 used a custom field for their main registration.
|
||||
@@ -590,6 +599,10 @@ async def event_import_reg(
|
||||
event_person_id = event_person_result.get('event_person_id')
|
||||
event_badge_id = event_person_result.get('event_badge_id')
|
||||
event_person_profile_id = event_person_result.get('event_person_profile_id')
|
||||
|
||||
# event_person_data.pop('allow_tracking') # Leave this alone as a backup reference?
|
||||
# event_person_data['event_badge'].pop('allow_tracking') # We do not want to override their onsite selection
|
||||
|
||||
log.info(f'Found Event Person. Updating existing... Event Person ID: {event_person_id}')
|
||||
if create_event_person_obj_result := create_update_event_person_obj_v4(
|
||||
event_person_dict_obj = event_person_data,
|
||||
|
||||
Reference in New Issue
Block a user