Mailing List Archive

jinja2 problems with POST request args
Hi,

While migrating to jinja2, I encounter problems (Missing or invalid form
token. Do you have cookies enabled?) when I want to do specific action on a
POST request.
I had a look at TRAC 1.4.1 ticket code, but I dont see any differences with
what am I doing.
After a look on the net, I found nothing that could help me.

Do you have any idea on how I could see what request is send. The problem
occurs before I enter process_request, therefore I can't display anything.
In my template I have a div button in a form:

<form class="addnew" enctype="multipart/form-data" method="post" action="
*${*href.downloads()*}*">

<fieldset>

<div class="buttons">

<input type="submit" name="submit" value="Add" />

<input type="hidden" name="action" value="post-add" />

</div>

</fieldset>

</form>

When I clic on the button I got the message:

Missing or invalid form token. Do you have cookies enabled?

Cédric

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/f82b5d53-43ca-417c-ab54-433e78d2d202n%40googlegroups.com.
Re: jinja2 problems with POST request args [ In reply to ]
In fact I found that we have to make it manually in the template while with
genshi it was done automatically:
Simply add ${jmacros.form_token_input()} after <form method="post">


On Wednesday, September 2, 2020 at 6:00:53 PM UTC+2 cedric...@gmail.com
wrote:

> Hi,
>
> While migrating to jinja2, I encounter problems (Missing or invalid form
> token. Do you have cookies enabled?) when I want to do specific action on a
> POST request.
> I had a look at TRAC 1.4.1 ticket code, but I dont see any differences
> with what am I doing.
> After a look on the net, I found nothing that could help me.
>
> Do you have any idea on how I could see what request is send. The problem
> occurs before I enter process_request, therefore I can't display anything.
> In my template I have a div button in a form:
>
> <form class="addnew" enctype="multipart/form-data" method="post" action="
> *${*href.downloads()*}*">
>
> <fieldset>
>
> <div class="buttons">
>
> <input type="submit" name="submit" value="Add" />
>
> <input type="hidden" name="action" value="post-add" />
>
> </div>
>
> </fieldset>
>
> </form>
>
> When I clic on the button I got the message:
>
> Missing or invalid form token. Do you have cookies enabled?
>
> Cédric
>

--
You received this message because you are subscribed to the Google Groups "Trac Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trac-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trac-users/6649770c-cec9-4454-af99-ad32a3fe09e1n%40googlegroups.com.