Updated get user object
This commit is contained in:
@@ -559,10 +559,11 @@ async def lookup_username(
|
||||
return mk_resp(data=data)
|
||||
|
||||
|
||||
@router.get('/{obj_id}', response_model=Resp_Body_Base)
|
||||
@router.get('/{user_id}', response_model=Resp_Body_Base)
|
||||
async def get_user_obj(
|
||||
obj_id: str = Query(..., min_length=1, max_length=22),
|
||||
user_id: str = Query(..., min_length=1, max_length=22),
|
||||
x_account_id: str = Header(...),
|
||||
inc_roles: bool = False,
|
||||
inc_contact: bool = False,
|
||||
inc_organization: bool = False,
|
||||
inc_person: bool = False,
|
||||
@@ -572,14 +573,15 @@ async def get_user_obj(
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
obj_type = 'user'
|
||||
result = get_obj_template(
|
||||
obj_type=obj_type,
|
||||
obj_id=obj_id,
|
||||
by_alias=True,
|
||||
exclude_unset=True,
|
||||
)
|
||||
return result
|
||||
user_obj = load_user_obj(
|
||||
user_id=user_id,
|
||||
inc_roles=inc_roles,
|
||||
inc_contact=inc_contact,
|
||||
inc_organization=inc_organization,
|
||||
inc_person=inc_person
|
||||
).dict(by_alias=by_alias, exclude_unset=exclude_unset)
|
||||
data = user_obj
|
||||
return mk_resp(data=data)
|
||||
|
||||
|
||||
@router.delete('/{obj_id}', response_model=Resp_Body_Base)
|
||||
|
||||
Reference in New Issue
Block a user