A lot of route common params clean up

This commit is contained in:
Scott Idem
2022-01-05 15:44:06 -05:00
parent e5d80908ce
commit 104bc8d08a
2 changed files with 17 additions and 34 deletions

View File

@@ -89,7 +89,7 @@ async def v3_post_person_obj_new(
log.debug(locals())
if create_update_person_obj_result := create_update_person_obj_v4b(
account_id = x_account['id'],
account_id = commons.x_account_id,
person_dict_obj = person_obj,
person_id = None,
# process_contact = process_contact,
@@ -153,7 +153,7 @@ async def v3_patch_person_obj_exist(
else: return mk_resp(data=None, status_code=404, response=commons.response, status_message='The person was not updated. The person ID was invalid or not found.')
if create_update_person_obj_result := create_update_person_obj_v4b(
account_id = x_account['id'],
account_id = commons.x_account_id,
person_dict_obj = person_obj,
person_id = person_id,
# process_contact = process_contact,
@@ -208,7 +208,7 @@ async def post_person_json(
log.debug(locals())
if person_obj_in_result := create_update_person_obj_v4b(
account_id = x_account['id'],
account_id = commons.x_account_id,
person_dict_obj = person_obj,
person_id = None,
process_contact = process_contact,
@@ -246,7 +246,7 @@ async def patch_person_json(
else: return mk_resp(data=None, status_code=404, response=commons.response)
if person_obj_up_result := create_update_person_obj_v4b(
account_id = x_account['id'],
account_id = commons.x_account_id,
person_dict_obj = person_obj,
process_contact = process_contact,
process_organization = process_organization,
@@ -290,7 +290,6 @@ async def get_person_obj_li(
# Updated 2021-08-19
@router.get('/person/external_id', response_model=Resp_Body_Base)
async def person_obj_external_id(
account_id: str = Query(..., min_length=1, max_length=22),
external_id: str = Query(..., min_length=1, max_length=75),
inc_address: bool = False,
inc_contact: bool = False,
@@ -302,8 +301,7 @@ async def person_obj_external_id(
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
if account_id := redis_lookup_id_random(record_id_random=account_id, table_name='account'): pass
else: return mk_resp(data=None, status_code=404, response=commons.response)
account_id = commons.x_account_id
# account_id = 99 # WARNING!!!! Get rid of 99!
if person_data := get_person_rec_w_external_id(account_id=account_id, external_id=external_id): pass
@@ -345,8 +343,7 @@ async def lookup_email(
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
if account_id := redis_lookup_id_random(record_id_random=x_account['id'], table_name='account'): pass
else: return mk_resp(data=None, status_code=404, response=commons.response)
account_id = commons.x_account_id
# import time
@@ -402,8 +399,7 @@ async def email_auth_key_url(
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
if account_id := redis_lookup_id_random(record_id_random=x_account['id'], table_name='account'): pass
else: return mk_resp(data=False, status_code=404, response=commons.response) # Not Found
account_id = commons.x_account_id
if person_id := redis_lookup_id_random(record_id_random=person_id, table_name='person'): pass
else: return mk_resp(data=False, status_code=404, response=commons.response) # Not Found