Ejemplo n.º 1
0
def join_event():
    content = request.get_json(force=True)

    User.join_event(content.get('user_id'), content.get('event_id'))
    Event.add_visitor(content.get('event_id'))

    return jsonify({"joined_event": Event.find(content.get('event_id')).name})
Ejemplo n.º 2
0
def list_companies():
    event_id = request.args.get('event_id')

    Event.add_visitor(event_id)

    companies = Company.get_companies_sp_list(event_id)

    active_companies = []
    for company in companies:
        if Event.find(event_id).subscriptable:
            if Payment.check_for_payment(event_id, company.id):
                active_companies.append(company.to_dict())
        else:
            active_companies.append(company.to_dict())

    print(active_companies)

    return jsonify(active_companies)