Exemplo n.º 1
0
def pdp_request():
    try:
        pdp_data = load_json_from_request(request)
        veredict = pdpc.pdp_main(db.session, pdp_data)
    except HTTPRequestError as err:
        return format_response(err.errorCode, err.message)
    else:
        return make_response(json.dumps({
            "decision": veredict,
            "status": "ok"
        }, default=json_serial), 200)
Exemplo n.º 2
0
def pdpRequest():
    try:
        pdpData = loadJsonFromRequest(request)
        veredict = pdpc.pdpMain(db.session, pdpData)
    except HTTPRequestError as err:
        return formatResponse(err.errorCode, err.message)
    else:
        return make_response(json.dumps({
                                        "decision": veredict,
                                        "status": "ok"
                                        }), 200)