Ejemplo n.º 1
0
 def test_get_by_flow(self):
     flow_id = 1
     name = 'test_table'
     columns = [{'name': 'test', 'type': 'STRING'}]
     email = '*****@*****.**'
     in_flow = Flow.create(flow_id, name, columns, email)
     flow = Flow.get_by_flow(flow_id)
     self.assertEquals(in_flow.id, flow.id)
Ejemplo n.º 2
0
 def test_get_by_flow(self):
     flow_id = 1
     name = 'test_table'
     columns = [{'name': 'test', 'type': 'STRING'}]
     email = '*****@*****.**'
     in_flow = Flow.create(flow_id, name, columns, email)
     flow = Flow.get_by_flow(flow_id)
     self.assertEquals(in_flow.id, flow.id)
Ejemplo n.º 3
0
def save_run():
    action = 'insert'
    data = request.json or request.form
    phone = data.get('phone')
    flow_id = data.get('flow')
    email = request.args.get('email')
    base_language = data.get('flow_base_language')
    values = json.loads(data.get('values'))

    flow = Flow.get_by_flow(flow_id)
    if flow:
        update_fusion_table.delay(flow.id, phone, values, email, base_language)
    else:
        action = 'create and insert'
        create_flow_and_update_ft.delay(data, email, phone, values, base_language)

    response = {'action': action}
    return create_response(response)
Ejemplo n.º 4
0
def save_run():
    action = 'insert'
    data = request.json or request.form
    phone = data.get('phone')
    flow_id = data.get('flow')
    email = request.args.get('email')
    base_language = data.get('flow_base_language')
    values = json.loads(data.get('values'))

    flow = Flow.get_by_flow(flow_id)
    if flow:
        update_fusion_table.delay(flow.id, phone, values, email, base_language)
    else:
        action = 'create and insert'
        create_flow_and_update_ft.delay(data, email, phone, values,
                                        base_language)

    response = {'action': action}
    return create_response(response)