Example #1
0
def add_host():
    data = request.json
    new_host = Host.make_new(data)

    if 'w9_received' in data:
        new_host.w9_received = data['w9_received']

    db.session.add(new_host)
    db.session.commit()
    return Response('Host {} {} created'.format(new_host.first_name,
                                                new_host.last_name),
                    status=201,
                    mimetype='application/json')
Example #2
0
def signup_host():
    new_host = Host.make_new(request.json)
    db.session.add(new_host)
    db.session.commit()
    return Response('submit success', status=201, mimetype='application/json')