I am not familiar with the function

reportes.impresion_tramite(...)

what does it return? If your intention is to return the PDF to the
user (http 200 ok) you cannot redirect (http 303 redirect). The two
statements are not compatible.

Massimo



On Jun 9, 12:11 pm, Jose <[email protected]> wrote:
> Hello
>
> At the end of the load of information on the part of the user there is
> a link to the following function:
>
> def terminar():
>     if session.documento is None:
>         redirect(URL(r=request, c='default', f='index'))
>     ...
>
>     if solicitud[0].id > 0:
>         response.headers['Content-Type']='application/pdf'
>         response.headers['Content-Disposition'] = 'attachment;
> filename=solicitud.pdf'
>
>         return reportes.impresion_tramite(solicitud[0].IdMatricula,
> solicitud[0].Fecha)
>     else:
>         return None
>
> This one generates a file pdf. What I want is that after generating
> the pdf, redirect to index
>
> If I put the redirect before the return it does not create the pdf, if
> I put it after does not work.
> Since I must do?
>
> Regards
> Jose
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to