예제 #1
0
async def register_new_user(user_in: UserIn):
    user_in_db = register_user(user_in)
    if user_in_db == None:
        raise HTTPException(
            status_code=404,
            detail="Ya existe un usuario registrado con ese username en la db")
    return {"Registrado": True}
예제 #2
0
async def formulario(user_select: userIn):

    user_in_db = get_user(user_select.user)
    if user_in_db != None:
        raise HTTPException(status_code=404, detail="El usuario ya existe")
    else:
        a = register_user(user_select)
        return a
예제 #3
0
async def register_user(user_select: userIn):
    
    user_in = get_user(user_select.user)

    if user_in != None: 
        raise HTTPException(status_code=404, detail="Usuario ya existe")
    
    else:
        transaction_user = register_user(User(**user_select.dict()))

        user_out = userOut(**user_select.dict())
        return user_out