Including account_name in user model

This commit is contained in:
Scott Idem
2021-12-30 18:58:56 -05:00
parent 2b809e0f81
commit 7fe0c4ae27
2 changed files with 4 additions and 3 deletions

View File

@@ -154,6 +154,7 @@ class User_Out_Base(BaseModel):
account_id_random: Optional[str]
#account_id: Optional[int]
account_name: Optional[str]
contact_id_random: Optional[str]
#contact_id: Optional[int]
@@ -240,6 +241,7 @@ class User_Base(BaseModel):
)
account_id_random: Optional[str]
account_id: Optional[int]
account_name: Optional[str]
# contact_id_random: Optional[str]
# contact_id: Optional[int]

View File

@@ -864,7 +864,7 @@ async def email_auth_key_url(
# Working well as of 2021-06-25. Using as a template for other routes.
@router.get('/user/{user_id}', response_model=Resp_Body_Base)
async def get_user_obj(
user_id: str = Query(..., min_length=1, max_length=22),
user_id: str = Query(..., min_length=11, max_length=22),
limit: int = 500, # For now this covers any included objects or object lists
enabled: str = 'enabled', # For now this covers any included objects or object lists
inc_address: bool = False, # Priority l1
@@ -895,8 +895,7 @@ async def get_user_obj(
log.debug(locals())
if user_id := redis_lookup_id_random(record_id_random=user_id, table_name='user'): pass
else:
return mk_resp(data=None, status_code=404, response=response)
else: return mk_resp(data=None, status_code=404, response=response)
if user_result := load_user_obj(
user_id = user_id,