A lot of code clean up! Also adding in Response everywhere...

This commit is contained in:
Scott Idem
2021-08-10 18:09:34 -04:00
parent 73466456ee
commit d933395a9f
57 changed files with 290 additions and 147 deletions

View File

@@ -19,6 +19,9 @@ from app.models.user_models import User_Base, User_New_Base, User_Out_Base
# ### BEGIN ### API User Methods ### create_user_obj() ###
# NOTE: This will create a new user and also hash a new password string if given.
# NOTE: This uses the User_New_Base model, not User_Base or User_Out_Base
# Reviewed and updated 2021-08-10
def create_user_obj(user_obj_new:User_New_Base) -> int|bool:
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
@@ -27,8 +30,6 @@ def create_user_obj(user_obj_new:User_New_Base) -> int|bool:
return False
# user_obj_data = user_obj_new.dict(by_alias=False, exclude_defaults=False, include={'password'}, exclude={'new_password'})
# log.debug(user_obj_data)
user_obj_data = user_obj_new.dict(by_alias=False, exclude_defaults=False, exclude_unset=True, exclude={'new_password'})
log.debug(user_obj_data)