Ejemplo n.º 1
0
    def post(self, request: HttpRequest, workflow: Workflow):
        workflow2 = workflow.duplicate(request.user)
        serializer = WorkflowSerializerLite(workflow2,
                                            context={'request': request})

        server.utils.log_user_event(request, 'Duplicate Workflow',
                                    {'name': workflow.name})

        async_to_sync(workflow2.last_delta.schedule_execute)()

        return JsonResponse(serializer.data, status=status.HTTP_201_CREATED)
Ejemplo n.º 2
0
    def post(self, request: HttpRequest, workflow: Workflow):
        workflow2 = workflow.duplicate(request.user)
        serializer = WorkflowSerializerLite(workflow2,
                                            context={'request': request})

        server.utils.log_user_event_from_request(request, 'Duplicate Workflow',
                                                 {'name': workflow.name})

        async_to_sync(rabbitmq.queue_render)(workflow2.id,
                                             workflow2.last_delta_id)

        return JsonResponse(serializer.data, status=status.HTTP_201_CREATED)