Ejemplo n.º 1
0
def clone_state(request, state_id):
    state = State.objects.get(id=state_id)
    config = Configuration.objects.get(pk=1)

    new_state = State(name=request.POST.get('state_name') or old_state.name)
    new_state.state = state.state
    new_state.save()
    return redirect(new_state.view_state_url())