Updates for Cvent and IDAA custom status field
This commit is contained in:
@@ -467,7 +467,7 @@ def create_update_aether_person(
|
||||
cvent_contact_obj: dict,
|
||||
account_id: str,
|
||||
person_id: str=None,
|
||||
log_lvl: int = logging.INFO, # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log_lvl: int = logging.DEBUG, # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
):
|
||||
log.setLevel(log_lvl)
|
||||
|
||||
|
||||
@@ -100,12 +100,19 @@ async def refresh_membership_status(
|
||||
log.warning(f'The SQL UPDATE of user table records failed for not members')
|
||||
|
||||
|
||||
# sql = f"""
|
||||
# UPDATE person
|
||||
# INNER JOIN membership_person ON person.id = membership_person.person_id
|
||||
# SET person.enable = 1, person.group = 'pending_member'
|
||||
# WHERE person.account_id = 13 AND membership_person.end_on >= NOW()
|
||||
# AND (person.external_sys_id IS NULL OR person.external_sys_id = '');
|
||||
# """
|
||||
sql = f"""
|
||||
UPDATE person
|
||||
INNER JOIN membership_person ON person.id = membership_person.person_id
|
||||
SET person.enable = 1, person.group = 'pending_member'
|
||||
WHERE person.account_id = 13 AND membership_person.end_on >= NOW()
|
||||
AND (person.external_sys_id IS NULL OR person.external_sys_id = '');
|
||||
AND person.status = 'pending';
|
||||
"""
|
||||
if person_update_result := sql_update(sql=sql):
|
||||
# Pull out IDs of existing person record
|
||||
@@ -118,7 +125,7 @@ async def refresh_membership_status(
|
||||
INNER JOIN membership_person ON person.id = membership_person.person_id
|
||||
SET person.enable = 1, person.group = 'current_member'
|
||||
WHERE person.account_id = 13 AND membership_person.end_on >= NOW()
|
||||
AND (person.external_sys_id IS NOT NULL AND person.external_sys_id != '');
|
||||
AND (person.status IS NULL OR person.status = 'approved');
|
||||
"""
|
||||
if person_update_result := sql_update(sql=sql):
|
||||
# Pull out IDs of existing person record
|
||||
|
||||
Reference in New Issue
Block a user