Code clean up and standardize

This commit is contained in:
Scott Idem
2021-08-25 11:16:02 -04:00
parent 1369874dc2
commit 8ff404e534
7 changed files with 21 additions and 13 deletions

View File

@@ -221,7 +221,7 @@ async def post_event_person_new(
user_id = None
user_obj = None
create_user_obj_result = create_user_obj(user_obj_new=user_obj_new)
create_user_obj_result = create_user_obj(account_id=account_id_random, user_obj_new=user_obj_new)
if isinstance(create_user_obj_result, bool):
log.debug('Returning False since multiple users were found with the same username.')
return mk_resp(data=False)

View File

@@ -60,7 +60,10 @@ async def post_user_obj_new(
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug(locals())
if create_user_obj_result := create_user_obj(user_obj_new=user_obj, allow_update=allow_update, avoid_dup_username=avoid_dup_username): pass
if account_id_random := user_obj.account_id_random: pass
else: return False
if create_user_obj_result := create_user_obj(account_id=account_id_random, user_obj_new=user_obj, allow_update=allow_update, avoid_dup_username=avoid_dup_username): pass
else: return mk_resp(data=False, status_code=400, response=response, status_message='The user account was not created. This is likely because that username already exists for this account.')
if isinstance(create_user_obj_result, int):