Ejemplo n.º 1
0
def rechazar_video(request, tk_str):
    v = token.is_valid_token(tk_str)
    if not v:
        return render_to_response("section-ticket-caducado.html")

    if request.method == "POST":
        form = IncidenciaProduccionForm(request.POST)
        if form.is_valid():
            inpro = form.save(commit=False)
            inpro.informe = v.informeproduccion
            inpro.aceptado = False
            inpro.save()
            token.token_attended(v)
            v.status = "REC"
            v.save()
            return render_to_response(
                "section-resumen-aprobacion.html", {"v": v, "aprobado": False}, context_instance=RequestContext(request)
            )
    else:
        form = IncidenciaProduccionForm()
    return render_to_response(
        "section-rechazar-produccion.html",
        {"v": v, "form": form, "token": tk_str},
        context_instance=RequestContext(request),
    )
Ejemplo n.º 2
0
def rechazar_video(request, tk_str):
    v = token.is_valid_token(tk_str)
    if not v: return render_to_response("postproduccion/section-ticket-caducado.html")

    if request.method == 'POST':
        form = IncidenciaProduccionForm(request.POST)
        if form.is_valid():
            inpro = form.save(commit = False)
            inpro.informe = v.informeproduccion
            inpro.aceptado = False
            inpro.save()
            token.token_attended(v)
            v.status = 'REC'
            v.save()
            return render_to_response("postproduccion/section-resumen-aprobacion.html", { 'v' : v, 'aprobado' : False }, context_instance=RequestContext(request))
    else:
        form = IncidenciaProduccionForm()
    return render_to_response("postproduccion/section-rechazar-produccion.html", { 'v' : v, 'form' : form, 'token' : tk_str }, context_instance=RequestContext(request))
Ejemplo n.º 3
0
def gestion_tickets(request, video_id):
    v = get_object_or_404(Video, pk=video_id)
    if v.status == 'LIS': raise Http404
    tk = token.get_token_data(v)

    if request.method == 'POST':
        form = IncidenciaProduccionForm(request.POST)
        if form.is_valid():
            inpro = form.save(commit = False)
            inpro.informe = v.informeproduccion
            inpro.emisor = 'O'
            inpro.save()
            v.status = 'PTU'
            v.save()
            token.send_custom_mail_to_user(v, inpro.comentario, request.user.first_name)
            messages.success(request, "Ticket generado y enviado al usuario")
            return redirect('gestion_tickets', v.id)
    else:
        form = IncidenciaProduccionForm()

    return render_to_response("postproduccion/section-gestion-tickets.html", { 'v' : v, 'form' : form, 'token' : tk }, context_instance=RequestContext(request))