(request, uid)
return redirect(url)
View used to execute recipes and start a 'Queued' job.
View used to execute recipes and start a 'Queued' job.
View used to execute recipes and start a Queued job .
def recipe_run(request, uid):
    """
    View used to execute recipes and start a 'Queued' job.
    """

    recipe = Analysis.objects.filter(uid=uid).first()

    # Form submission.
    if request.method == "POST":
        form = forms.RecipeInterface(request=request, analysis=recipe, json_data=recipe.json_data,
                                     data=request.POST, files=request.FILES)
        # The form validation will authorize the job.
        if form.is_valid():
            # Create the job from the recipe and incoming json data.
            job = auth.create_job(analysis=recipe, user=request.user, fill_with=form.cleaned_data)
            # Spool via UWSGI or start it synchronously.
            tasks.execute_job.spool(job_id=job.id)
            url = reverse("recipe_view", kwargs=dict(uid=recipe.uid)) + "#results"
            return redirect(url)
        else:
            messages.error(request, form.errors)

    url = reverse("recipe_view", kwargs=dict(uid=recipe.uid)) + "#run"

    return redirect(url)
def recipe_run ( request , uid ) : recipe = Analysis . objects . filter ( uid = uid ) . first ( ) # Form submission. if request . method == "POST" : form = forms . RecipeInterface ( request = request , analysis = recipe , json_data = recipe . json_data , data = request . POST , files = request . FILES ) # The form validation will authorize the job. if form . is_valid ( ) : # Create the job from the recipe and incoming json data. job = auth . create_job ( analysis = recipe , user = request . user , fill_with = form . cleaned_data ) # Spool via UWSGI or start it synchronously. tasks . execute_job . spool ( job_id = job . id ) url = reverse ( "recipe_view" , kwargs = dict ( uid = recipe . uid ) ) + "#results" return redirect ( url ) else : messages . error ( request , form . errors ) url = reverse ( "recipe_view" , kwargs = dict ( uid = recipe . uid ) ) + "#run" return redirect ( url )