Code clean up. Bug fixes for person, user, contact, and address methods. Fix bug for get_account_id_w_for_type_id()
This commit is contained in:
@@ -27,7 +27,13 @@ async def post_person_obj(
|
||||
contact_id: str = Query(None, min_length=11, max_length=22),
|
||||
organization_id: str = Query(None, min_length=11, max_length=22),
|
||||
user_id: str = Query(None, min_length=11, max_length=22),
|
||||
|
||||
inc_address: bool = False,
|
||||
inc_contact: bool = False,
|
||||
inc_organization: bool = False,
|
||||
inc_user: bool = False,
|
||||
return_obj: bool = True,
|
||||
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
@@ -62,10 +68,10 @@ async def post_person_obj(
|
||||
if return_obj:
|
||||
person_obj = load_person_obj(
|
||||
person_id = person_id,
|
||||
inc_address = False,
|
||||
inc_contact = False,
|
||||
inc_organization = False,
|
||||
inc_user = False
|
||||
inc_address = inc_address,
|
||||
inc_contact = inc_contact,
|
||||
inc_organization = inc_organization,
|
||||
inc_user = inc_user
|
||||
).dict(by_alias=commons.by_alias, exclude_unset=commons.exclude_unset)
|
||||
data = person_obj
|
||||
else:
|
||||
@@ -83,7 +89,13 @@ async def patch_person_obj(
|
||||
contact_id: str = Query(None, min_length=11, max_length=22),
|
||||
organization_id: str = Query(None, min_length=11, max_length=22),
|
||||
user_id: str = Query(None, min_length=11, max_length=22),
|
||||
|
||||
inc_address: bool = False,
|
||||
inc_contact: bool = False,
|
||||
inc_organization: bool = False,
|
||||
inc_user: bool = False,
|
||||
return_obj: Optional[bool] = True,
|
||||
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
@@ -121,10 +133,10 @@ async def patch_person_obj(
|
||||
if return_obj:
|
||||
person_obj = load_person_obj(
|
||||
person_id = person_id,
|
||||
inc_address = False,
|
||||
inc_contact = False,
|
||||
inc_organization = False,
|
||||
inc_user = False
|
||||
inc_address = inc_address,
|
||||
inc_contact = inc_contact,
|
||||
inc_organization = inc_organization,
|
||||
inc_user = inc_user
|
||||
).dict(by_alias=commons.by_alias, exclude_unset=commons.exclude_unset)
|
||||
data = person_obj
|
||||
else:
|
||||
@@ -153,7 +165,7 @@ async def v3_post_person_obj_new(
|
||||
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if create_update_person_obj_result := create_update_person_obj_v4b(
|
||||
@@ -214,7 +226,7 @@ async def v3_patch_person_obj_exist(
|
||||
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if person_id := redis_lookup_id_random(record_id_random=person_id, table_name='person'): pass
|
||||
@@ -272,7 +284,7 @@ async def post_person_json(
|
||||
return_obj: Optional[bool] = True,
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if person_obj_in_result := create_update_person_obj_v4b(
|
||||
@@ -307,7 +319,7 @@ async def patch_person_json(
|
||||
return_obj: Optional[bool] = True,
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if person_id := redis_lookup_id_random(record_id_random=person_id, table_name='person'): pass
|
||||
@@ -339,7 +351,7 @@ async def get_person_obj_li(
|
||||
for_obj_id: Optional[str] = Query(None, min_length=1, max_length=22),
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
obj_type = 'person'
|
||||
@@ -366,7 +378,7 @@ async def person_obj_external_id(
|
||||
inc_user_role_list: bool = False,
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
account_id = commons.x_account_id
|
||||
@@ -408,7 +420,7 @@ async def lookup_email(
|
||||
inc_user_role_list: bool = False,
|
||||
commons: Common_Route_Params = Depends(common_route_params),
|
||||
):
|
||||
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.setLevel(logging.INFO) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
account_id = commons.x_account_id
|
||||
|
||||
Reference in New Issue
Block a user