From 7fe0c4ae27326a5524684b047c74732eab0722d8 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 30 Dec 2021 18:58:56 -0500 Subject: [PATCH] Including account_name in user model --- app/models/user_models.py | 2 ++ app/routers/user.py | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/models/user_models.py b/app/models/user_models.py index 7cd8a5b..a75694b 100644 --- a/app/models/user_models.py +++ b/app/models/user_models.py @@ -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] diff --git a/app/routers/user.py b/app/routers/user.py index bc37575..4536bc5 100644 --- a/app/routers/user.py +++ b/app/routers/user.py @@ -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,