inventorymgr/users.py
def new_user() -> Dict[str, Any]:
    """Flask view to create a new user using POST."""
    user_obj = api.NewUser.parse_obj(request.json)

    try:
        user = service.create_user(user_obj)
        return api.User.from_orm(user).dict()
    except IntegrityError as exc:
        raise APIError(reason="user_exists", status_code=400) from exc
Flask view to create a new user using POST.
Flask view to create a new user using POST.
Flask view to create a new user using POST .
def new_user() -> Dict[str, Any]:
    user_obj = api.NewUser.parse_obj(request.json)
    try:
        user = service.create_user(user_obj)
        return api.User.from_orm(user).dict()
    except IntegrityError as exc:
        raise APIError(reason="user_exists", status_code=400) from exc
def new_user ( ) -> Dict [ str , Any ] : user_obj = api . NewUser . parse_obj ( request . json ) try : user = service . create_user ( user_obj ) return api . User . from_orm ( user ) . dict ( ) except IntegrityError as exc : raise APIError ( reason = "user_exists" , status_code = 400 ) from exc
Flask view to create a new user using POST.
Flask view to create a new user using POST .
"""Flask view to create a new user using POST."""