Ejemplo n.º 1
0
def script_update(script_id):
    script_store = stores.get_store('scripts')
    rec = script_store.get(script_id)
    if rec is None:
        return _not_found_error("Script not found")

    script = Script(**rec[0])
    script.update(request.json)
    script_store[script.id] = [script.to_dict(), clock.tick()]

    return dict(status=defines.SUCCESS, data=script_id)
Ejemplo n.º 2
0
def script_update(script_id):
    script_store = stores.get_store('scripts')
    rec = script_store.get(script_id)
    if rec is None:
        return _not_found_error("Script not found")

    script = Script(**rec[0])
    script.update(request.json)
    script_store[script.id] = [script.to_dict(), clock.tick()]

    return dict(status=defines.SUCCESS, data=script_id)