Work on importing person and membership data
This commit is contained in:
@@ -277,7 +277,7 @@ async def ins_up_person_contact_address_user_data(
|
|||||||
else:
|
else:
|
||||||
log.warning('No email address was found.')
|
log.warning('No email address was found.')
|
||||||
continue
|
continue
|
||||||
log.debug(f'External ID: {external_id}, Source ID {source_id}, Email: {email}')
|
log.info(f'External ID: {external_id}, Source ID {source_id}, Email: {email}')
|
||||||
|
|
||||||
person_data = {}
|
person_data = {}
|
||||||
if source_id:
|
if source_id:
|
||||||
@@ -285,7 +285,7 @@ async def ins_up_person_contact_address_user_data(
|
|||||||
else:
|
else:
|
||||||
person_data['external_import_id'] = email
|
person_data['external_import_id'] = email
|
||||||
external_import_id = person_data['external_import_id']
|
external_import_id = person_data['external_import_id']
|
||||||
log.info(external_import_id)
|
log.debug(external_import_id)
|
||||||
|
|
||||||
if record.get('informal_name'): person_data['informal_name'] = record.get('informal_name')
|
if record.get('informal_name'): person_data['informal_name'] = record.get('informal_name')
|
||||||
if record.get('given_name'): person_data['given_name'] = record.get('given_name')
|
if record.get('given_name'): person_data['given_name'] = record.get('given_name')
|
||||||
@@ -397,7 +397,6 @@ async def ins_up_person_contact_address_user_data(
|
|||||||
|
|
||||||
if person_rec_result := sql_select(data=data, sql=sql):
|
if person_rec_result := sql_select(data=data, sql=sql):
|
||||||
# Pull out IDs and UPDATE existing person record
|
# Pull out IDs and UPDATE existing person record
|
||||||
log.info('Found one record')
|
|
||||||
log.debug(person_rec_result)
|
log.debug(person_rec_result)
|
||||||
person_rec = person_rec_result
|
person_rec = person_rec_result
|
||||||
person_id = person_rec.get('person_id', None)
|
person_id = person_rec.get('person_id', None)
|
||||||
@@ -405,6 +404,7 @@ async def ins_up_person_contact_address_user_data(
|
|||||||
address_id = person_rec.get('address_id', None)
|
address_id = person_rec.get('address_id', None)
|
||||||
user_id = person_rec.get('user_id', None)
|
user_id = person_rec.get('user_id', None)
|
||||||
person_data['id'] = person_id
|
person_data['id'] = person_id
|
||||||
|
log.info(f'Found Person ID: {person_id} Contact ID: {contact_id} Address ID: {address_id} User ID: {user_id}')
|
||||||
|
|
||||||
if 'created_on' in person_data:
|
if 'created_on' in person_data:
|
||||||
person_data.pop('created_on') # I don't want to reset the created date?
|
person_data.pop('created_on') # I don't want to reset the created date?
|
||||||
@@ -845,8 +845,8 @@ async def ins_up_membership_person_data(
|
|||||||
SELECT *
|
SELECT *
|
||||||
FROM `v_person` AS `person`
|
FROM `v_person` AS `person`
|
||||||
WHERE person.account_id = :account_id
|
WHERE person.account_id = :account_id
|
||||||
/*AND person.external_id = :external_id*/
|
AND person.external_id = :external_id
|
||||||
AND person.external_import_id = :external_import_id
|
/*AND person.external_import_id = :external_import_id*/
|
||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user